Hello all, I wonder if a query according to the following rules is possible.
We have several fields with increasing hierarchy, say f_0 to f_{2n}. The rule to search for a term is that starting with index 0 the first field to contain a hit defines whether to return the document or not, i.e.:
If Field f_{2i} contains the term -> return the document, don't look at further fields f_j with j>2i
If Field f_{2i+1} contains the term -> do not return the document and don't look at further fields f_j with j>2i+1
I call this cascaded fallback query, because each field f_{i+1} is kind of a fallback for the case that no field before it contained any explicit information for the term. If it were not for the fields with the negative information, I could just use a big OR over all the fields, but with negation this does not work.
Due to the algorithmic rather than plain boolean (set theoretic) function to be computed, I have the impression that just creating query objects the right way would not work, in particular given that at query time I cannot be sure about the size of n, so I don't know how many fields to include in the query.
I would even dare to dig deep down into the place where terms are matched agains fields in Lucene. I had a look already at the source code of IndexSearcher but could not really spot the place where terms are matched. But I may be looking at the wrong place.
Any hints appreciated, Harald. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org