Currently I am firing 3 Solr queries and doing operations in my servlet to achieve my requirement. My requirement is finding words that belong to non special category.
Special category words will have entries in special documents as well as normal documents, there will be two special categories. So I need to extract all the documents and remove the special categories from that. Currently I am doing that in servlet using Hash Maps.
Is it possible to do that in a Solr query without writing any handlers?
I wanted to achieve something like query1 - (query2 U query3)
You can use filter queries to exclude results of other queries from the original query. In Solr you can negate a query result using
-. This will not cover all possible Set Operations, but it should suffice for your needs.To give an example, assumed you query for T-Shirts of a certain company
Now you want to exclude those Shirts which are red or green. To do that you negate each query with a
-and you would add a separatefqparameter for each constraint.Putting all that together you would query for
References about filter queries