lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fitrio Pakana <>
Subject OR query return fewer result than AND query
Date Mon, 08 Dec 2003 02:50:32 GMT
I'm replying to Martin's e-mail that excerpted below
since I just join the mailing list and have no idea
hoe to reply to old e-mails.

I have similar problems with him, which is query using
multiple terms, and to make things worse, the hits
returned is quite absurd. The score of hits using 'OR'
(any words) query is lower than if using 'AND' (all
words) query, thus the number of result is fewer for
'OR' query, which I think is not a correct behaviour
for a search engine. Does anybody experience the same
problem? or any explainations/ideas?

Thanks, _Rio

Subject: multi query with boost AND multiple terms
Date: Thu, 6 Mar 2003 11:23:32 +1300
Content-Type: text/plain; charset="us-ascii"

Hi there,

I am trying to do a search on multiple terms inclusive
using boosting. I 
extended the MultiFieldQueryParser like this:

 public static
parse(String query, String[] 
fields, float[] boost,
        Analyzer analyzer)
        throws ParseException
        BooleanQuery bQuery = new BooleanQuery();
        for (int i = 0; i < fields.length; i++)
   q =
parse(query, fields[i], 
            bQuery.add(q, false, false);
        return bQuery;

It works fine for single term i.e searching for 'dvd'
results in:

name:dvd^6.0 shortDescription:dvd^4.0

But, if I have multiple term like 'dvd player' I get:

(name:dvd name:player) (mfName:dvd mfName:player)
shortDescription:player) (longDescription:dvd

Any ideas?

Cheers, Martin

Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message