How can we do an AND operation instead of an OR operation when the queryString contains more than <br>!_NEWLINE_!one words?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Probir_Mukerjee
Posted On:   Friday, May 31, 2002 07:04 AM

It seems that by default the Query Object created by QueryParser.parse( queryString, "contents", analyzer ); is always conducting an OR function. For example if a group of words is passed into the queryString without a operator, such as "Program file" ( two words seperated by space without the quotes), the Query object returned BooleanQuery object which is conducting an OR operation ( Program OR file ). I know this because the number of hits returned when I pass in more that one word into the queryString returns more hits that it does when only one word is passed into the queryString. I would like t   More>>



It seems that by default the Query Object created by

QueryParser.parse( queryString, "contents", analyzer );

is always conducting an OR function.



For example if a group of words is passed into the queryString without a

operator, such as "Program file" ( two words seperated by space without the quotes), the Query

object returned BooleanQuery object which is conducting an OR operation ( Program OR file ).




I know this because the number of hits returned when I pass in more that one word into the queryString

returns more hits that it does when only one word is passed into the queryString.



I would like to Query object returned to do an AND operation instead. Does anyone know how that could

be changed?    <<Less

Re: How can we do an AND operation instead of an OR operation when the queryString contains more than one word?

Posted By:   Otis_Gospodnetic  
Posted On:   Sunday, June 2, 2002 10:10 AM

This has been answered in the mailing list archives.
The new versions (post 1.2) will have allow you to change the default behaviour programmatically.


See http://nagoya.apache.org/eyebrowse/ReadMsg?listName=lucene-dev@jakarta.apache.org&msgId=115677.
About | Sitemap | Contact