lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Tinnes" <tin...@ecliptictech.com>
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",
analyzer);
        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 = searcher.search(main);
        for (int j=0; j<hits.length(); j++) {
            System.out.println("Result:" + hits.doc(j).get("url") + "
Score=" + hits.score(j));
        }
        searcher.close();


--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message