| java.lang.Object org.apache.lucene.search.CheckHits
CheckHits | public class CheckHits (Code) | | |
Inner Class :public static class ExplanationAssertingSearcher extends IndexSearcher | |
Inner Class :public static class ExplanationAsserter extends HitCollector | |
Field Summary | |
public static float | EXPLAIN_SCORE_TOLERANCE_DELTA Some explains methods calculate their vlaues though a slightly
differnet order of operations from the acctaul scoring method ... |
Method Summary | |
public static void | checkDocIds(String mes, int[] results, Hits hits) | public static void | checkEqual(Query query, Hits hits1, Hits hits2) | public static void | checkExplanations(Query query, String defaultFieldName, Searcher searcher) Asserts that the explanation value for every document matching a
query corresponds with the true score. | public static void | checkExplanations(Query query, String defaultFieldName, Searcher searcher, boolean deep) Asserts that the explanation value for every document matching a
query corresponds with the true score. | public static void | checkHitCollector(Query query, String defaultFieldName, Searcher searcher, int[] results) Tests that a query matches the an expected set of documents using a
HitCollector. | public static void | checkHits(Query query, String defaultFieldName, Searcher searcher, int[] results) Tests that a query matches the an expected set of documents using Hits. | public static void | checkHitsQuery(Query query, Hits hits1, Hits hits2, int[] results) Tests that two queries have an expected order of documents,
and that the two queries have the same score values. | public static void | checkNoMatchExplanations(Query q, String defaultFieldName, Searcher searcher, int[] results) | public static String | hits2str(Hits hits1, Hits hits2, int start, int end) | public static String | topdocsString(TopDocs docs, int start, int end) | public static void | verifyExplanation(String q, int doc, float score, boolean deep, Explanation expl) Assert that an explanation has the expected score, and optionally that its
sub-details max/sum/factor match to that score. |
EXPLAIN_SCORE_TOLERANCE_DELTA | public static float EXPLAIN_SCORE_TOLERANCE_DELTA(Code) | | Some explains methods calculate their vlaues though a slightly
differnet order of operations from the acctaul scoring method ...
this allows for a small amount of variation
|
checkDocIds | public static void checkDocIds(String mes, int[] results, Hits hits) throws IOException(Code) | | Tests that a Hits has an expected order of documents
|
checkExplanations | public static void checkExplanations(Query query, String defaultFieldName, Searcher searcher) throws IOException(Code) | | Asserts that the explanation value for every document matching a
query corresponds with the true score.
See Also: ExplanationAsserter See Also: CheckHits.checkExplanations(Query,String,Searcher,boolean) See Also: for a See Also: "deep" testing of the explanation details. Parameters: query - the query to test Parameters: searcher - the searcher to test the query against Parameters: defaultFieldName - used for displaing the query in assertion messages |
checkExplanations | public static void checkExplanations(Query query, String defaultFieldName, Searcher searcher, boolean deep) throws IOException(Code) | | Asserts that the explanation value for every document matching a
query corresponds with the true score. Optionally does "deep"
testing of the explanation details.
See Also: ExplanationAsserter Parameters: query - the query to test Parameters: searcher - the searcher to test the query against Parameters: defaultFieldName - used for displaing the query in assertion messages Parameters: deep - indicates whether a deep comparison of sub-Explanation details should be executed |
checkHitCollector | public static void checkHitCollector(Query query, String defaultFieldName, Searcher searcher, int[] results) throws IOException(Code) | | Tests that a query matches the an expected set of documents using a
HitCollector.
Note that when using the HitCollector API, documents will be collected
if they "match" regardless of what their score is.
Parameters: query - the query to test Parameters: searcher - the searcher to test the query against Parameters: defaultFieldName - used for displaing the query in assertion messages Parameters: results - a list of documentIds that must match the query See Also: Searcher.search(QueryHitCollector) See Also: CheckHits.checkHits |
checkHits | public static void checkHits(Query query, String defaultFieldName, Searcher searcher, int[] results) throws IOException(Code) | | Tests that a query matches the an expected set of documents using Hits.
Note that when using the Hits API, documents will only be returned
if they have a positive normalized score.
Parameters: query - the query to test Parameters: searcher - the searcher to test the query against Parameters: defaultFieldName - used for displaing the query in assertion messages Parameters: results - a list of documentIds that must match the query See Also: Searcher.search(Query) See Also: CheckHits.checkHitCollector |
checkHitsQuery | public static void checkHitsQuery(Query query, Hits hits1, Hits hits2, int[] results) throws IOException(Code) | | Tests that two queries have an expected order of documents,
and that the two queries have the same score values.
|
checkNoMatchExplanations | public static void checkNoMatchExplanations(Query q, String defaultFieldName, Searcher searcher, int[] results) throws IOException(Code) | | Tests that all documents up to maxDoc which are *not* in the
expected result set, have an explanation which indicates no match
(ie: Explanation value of 0.0f)
|
verifyExplanation | public static void verifyExplanation(String q, int doc, float score, boolean deep, Explanation expl)(Code) | | Assert that an explanation has the expected score, and optionally that its
sub-details max/sum/factor match to that score.
Parameters: q - String representation of the query for assertion messages Parameters: doc - Document ID for assertion messages Parameters: score - Real score value of doc with query q Parameters: deep - indicates whether a deep comparison of sub-Explanation details should be executed Parameters: expl - The Explanation to match against score |
|
|