My solr implementation has query something like this
q=(field1:ipod and field2:black) OR (field3:'apple computers') OR (field4:working)
There are essentially 3 conditions here separated by 'OR'. When i run this query i get the results. In the results i would like to see which of the 3 conditions were met. For example in the results in addition to the returned data (custom fields), specifically I would like to have cond1=true, cond2=true, cond3=false for each of the document returned.
Assume that there are no analysis will be done on these fields(1 to 4). All fields are string. Solr 4.6.1. Distributed.
Solutions tried (but without satisfactory results):
- debugquery=true seems to give too much verbose information (explain field), that i am not interested in, i am looking for simple fields to be added. i can get these debug xml-ized for parsing, but complicated for normal processing.
- group by (group.query) option would help by providing the conditions in the group.query so that we get this grouped by conditions, not the best option for me but just tried it. But it does not seem to work in distributed mode (SOLR-5046)
- Adding field function query, not able to do simple field to string equality check like _cond1_:if(field1=='ipod' and field2=='black'). There is no such equality check possible in the function query i guess.
Any other options solutions here? should i write custom similarity or custom Doc transformer here?