lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject multi query with boost AND multiple terms
Date Wed, 05 Mar 2003 22:23:32 GMT
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 longDescription:dvd^2.0

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

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

Any ideas?

Cheers, Martin

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

View raw message