Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter query "search_exclude" is set again even if set before #764

Closed
tobias-karrer opened this issue May 23, 2023 · 5 comments
Closed

filter query "search_exclude" is set again even if set before #764

tobias-karrer opened this issue May 23, 2023 · 5 comments

Comments

@tobias-karrer
Copy link

Query param &fq=search_exclude:"false" will be set in CmsSolrIndex#search() even if CmsSolrQuery query passed already contains the param.

There should be a check if already set before adding it here:
https://github.com/alkacon/opencms-core/blob/master/src/org/opencms/search/solr/CmsSolrIndex.java#L882

@gWestenberger
Copy link
Contributor

This is the intended behavior.

@gWestenberger gWestenberger closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2023
@tobias-karrer
Copy link
Author

This is the intended behavior.

Really?!?
Queries like &fq=search_exclude:"false"&fq=search_exclude:"false"&fq=search_exclude:"false" ... are intented?

@gWestenberger
Copy link
Contributor

It adding fq=search_exclude:"false", regardless of whether there is already another parameter fq=search_exclude:"xyz" or fq=-search_exclude:"xyz", is the intended behavior.

You only end up with your example &fq=search_exclude:"false"&fq=search_exclude:"false"&fq=search_exclude:"false" if you reuse a query object for multiple searches, so I suggest you don't do that.

@tobias-karrer
Copy link
Author

I do so to search in batches (where only "start" changes), as the search is limited to 400 resources.
Increasing maxProcessedResults is in parts possible, but does not help everywhere.
Rebuilding the whole query would not be effective.

As workaround I now remove the filter query for "search_exclude" before searching again.
But it would be better if CmsSolrIndex.java wouldn't set it multiple times.

gWestenberger added a commit that referenced this issue Sep 19, 2023
@gWestenberger
Copy link
Contributor

Good point. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants