lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Tinnes" <>
Subject search results
Date Wed, 07 Aug 2002 16:56:16 GMT
Can anyone tell me why the following code produces different search results
when using the latest lucene build as compared to the 1.2-RC5 build. I'm
using the latest build for the new setBoost method which if computed at
query time is more than likely my problem.

        StandardAnalyzer analyzer = new StandardAnalyzer();
        Query q1 = QueryParser.parse("("+qry+")^4", "title", analyzer);
        Query q2 = QueryParser.parse("("+qry+")^3", "keywords", analyzer);
        Query q3 = QueryParser.parse("("+qry+")^2", "description",
        Query q4 = QueryParser.parse("("+qry+")^1", "body", analyzer);
        BooleanQuery main = new BooleanQuery();
        main.add(q1, false, false);
        main.add(q2, false, false);
        main.add(q3, false, false);
        main.add(q4, false, false);
        Searcher searcher = new IndexSearcher(dir);
        Hits hits =;
        for (int j=0; j<hits.length(); j++) {
            System.out.println("Result:" + hits.doc(j).get("url") + "
Score=" + hits.score(j));

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

View raw message