lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <mar...@rectangular.com>
Subject Re: MultiFieldQueryParser.parse deprecated. What can I use?
Date Wed, 26 Jul 2006 04:35:06 GMT

On Jul 25, 2006, at 7:35 PM, Paulo Silveira wrote:

> hey doron, I solved the problem with
>
> for (String field : fields) {
> 	QueryParser qp = new QueryParser(field, SearchEngine.ANALYZER);
> 	fieldsQuery.add(qp.parse(string), BooleanClause.Occur.SHOULD);
> }

I believe that this will cause difficulties with prohibited terms.   
Say you have these two documents...

     Doc 1:
        title: a
        body:  foo
     Doc 2:
        title: b
        body:  bar

How many hits do you get for the query 'a -foo'?  The answer *should*  
be 0, since the presence of "foo" in the body should exclude doc 1.   
However, since the title matches against 'a -foo' ("a" is present,  
and "foo" is not), I believe you'll get a hit.

If you can solve that problem, and also return 1 hit for the query  
string "a +foo", let me know!

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message