lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jitender ahuja" <ajiten...@aalayance.com>
Subject AND & OR over fields to be searched upon
Date Mon, 28 Jun 2004 13:55:47 GMT
Hi All,
          -Doug submitted  a reply concerning a weighted ranking based on the query term containing
field, using an OR search, dated
 21 Aug 2002. His reply was as follows for higher ranking of field1 over field2:
"Index the text in both field1 and field2 in a new field, field3.  (Or, to save space and
if your application permits, just add the text from 
field1 to field2 too.)  Then search for:   field1:(token1^2 token2^2 token3^2) +field3:(+token1
+token2 +token3)"

Now, my issue is that I want both options 'AND' as well as 'OR'. So, if it is 'Or' then the
term(s) can be found in any one or more and 
I need to display the field in which the particular occurence in the Hits array was found.
But, if  the 'AND' condition is used then it 
must be found in all. The MultiQueryParser class does an 'OR' search. But, how to display
the field in which the particular Hits' 
array item was found in case of 'OR' search.The fields to be combined and the AND/OR options
are choosen from a multiple select box 
and a text box respectively by the user.

Regards,
Jitender
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message