I am not very sure if you are talking about a bit complex boolean queries.
According stardard boolean logic, complex if-else would be normalized by
using union, intersection, not.
you omited some of your logic, lets assume it as:
if( FieldA == myval1) {
if(FieldB == 1){
don't return the document;
} else {
return the document;
}
}else if(FieldA == myval2) {
if(FieldC == 1){
don't return the document;
} else {
return the document;
}
}else if(FieldA == myval3) {
if(FieldD == 1){
don't return the document;
} else {
return the document;
}
}
then you would use a boolean query as:
(FieldA:myval1 -FieldB:1) OR (FieldA:myval2 -FieldC:1) OR (FieldA:myval3
-FieldD:1)
see, this is a normalized boolean logic.
hope it helps.
2010/1/21 Noam G. <[email protected]>
>
> Hi Guys,
>
> I'll start by thanking every one for an amazing search engine!
>
> What am I trying to do? Basically what I need is the ability to do some
> kind
> of "switch" or an "if-else" flow based on the field value and a parameter
> that I will pass using the query string. The result will be documents that
> comply with this logic.
>
> For example (myval1, myval2 and myval3 are the params from the query
> string):
> if(index_value == myval1) {
> if(other_index_value == 1){
> don't return the document;
> } else {
> return the document;
> }
> }else if(index_value == myval2) {
> .......
> }else if(index_value == myval3) {
> .......
> }
>
> What should I override to implement this?
>
> Thank you very much,
>
> Noam.
> --
> View this message in context:
> http://old.nabble.com/Choosing-what-document-to-return.-tp27259310p27259310.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
--
梅旺生