Package org.apache.lucene.search

Examples of org.apache.lucene.search.Hits.score()


        try {
            assertEquals("3 docs should match " + q.toString(),
                         3, h.length());
            assertEquals("wrong first""d2", h.doc(0).get("id"));
            float score0 = h.score(0);
            float score1 = h.score(1);
            float score2 = h.score(2);
            assertTrue("d2 does not have better score then others: " +
                       score0 + " >? " + score1,
                       score0 > score1);
            assertEquals("d4 and d1 don't have equal scores",
View Full Code Here


            assertEquals("3 docs should match " + q.toString(),
                         3, h.length());
            assertEquals("wrong first""d2", h.doc(0).get("id"));
            float score0 = h.score(0);
            float score1 = h.score(1);
            float score2 = h.score(2);
            assertTrue("d2 does not have better score then others: " +
                       score0 + " >? " + score1,
                       score0 > score1);
            assertEquals("d4 and d1 don't have equal scores",
                         score1, score2, SCORE_COMP_THRESH);
View Full Code Here

        Hits h = s.search(q);

        try {
            assertEquals("3 docs should match " + q.toString(),
                         3, h.length());
            float score = h.score(0);
            for (int i = 1; i < h.length(); i++) {
                assertEquals("score #" + i + " is not the same",
                             score, h.score(i), SCORE_COMP_THRESH);
            }
        } catch (Error e) {
View Full Code Here

            assertEquals("3 docs should match " + q.toString(),
                         3, h.length());
            float score = h.score(0);
            for (int i = 1; i < h.length(); i++) {
                assertEquals("score #" + i + " is not the same",
                             score, h.score(i), SCORE_COMP_THRESH);
            }
        } catch (Error e) {
            printHits("testBooleanRequiredEqualScores1",h);
            throw e;
        }
View Full Code Here

        Hits h = s.search(q);

        try {
            assertEquals("4 docs should match " + q.toString(),
                         4, h.length());
            float score = h.score(0);
            for (int i = 1; i < h.length()-1; i++) { /* note: -1 */
                assertEquals("score #" + i + " is not the same",
                             score, h.score(i), SCORE_COMP_THRESH);
            }
            assertEquals("wrong last", "d1", h.doc(h.length()-1).get("id"));
View Full Code Here

            assertEquals("4 docs should match " + q.toString(),
                         4, h.length());
            float score = h.score(0);
            for (int i = 1; i < h.length()-1; i++) { /* note: -1 */
                assertEquals("score #" + i + " is not the same",
                             score, h.score(i), SCORE_COMP_THRESH);
            }
            assertEquals("wrong last", "d1", h.doc(h.length()-1).get("id"));
            float score1 = h.score(h.length()-1);
            assertTrue("d1 does not have worse score then others: " +
                       score + " >? " + score1,
View Full Code Here

            for (int i = 1; i < h.length()-1; i++) { /* note: -1 */
                assertEquals("score #" + i + " is not the same",
                             score, h.score(i), SCORE_COMP_THRESH);
            }
            assertEquals("wrong last", "d1", h.doc(h.length()-1).get("id"));
            float score1 = h.score(h.length()-1);
            assertTrue("d1 does not have worse score then others: " +
                       score + " >? " + score1,
                       score > score1);
        } catch (Error e) {
            printHits("testBooleanOptionalNoTiebreaker",h);
View Full Code Here

        try {

            assertEquals("4 docs should match " + q.toString(),
                         4, h.length());

            float score0 = h.score(0);
            float score1 = h.score(1);
            float score2 = h.score(2);
            float score3 = h.score(3);

            String doc0 = h.doc(0).get("id");
View Full Code Here

            assertEquals("4 docs should match " + q.toString(),
                         4, h.length());

            float score0 = h.score(0);
            float score1 = h.score(1);
            float score2 = h.score(2);
            float score3 = h.score(3);

            String doc0 = h.doc(0).get("id");
            String doc1 = h.doc(1).get("id");
View Full Code Here

            assertEquals("4 docs should match " + q.toString(),
                         4, h.length());

            float score0 = h.score(0);
            float score1 = h.score(1);
            float score2 = h.score(2);
            float score3 = h.score(3);

            String doc0 = h.doc(0).get("id");
            String doc1 = h.doc(1).get("id");
            String doc2 = h.doc(2).get("id");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.