C# 클래스 Lucene.Net.Search.CheckHits

파일 보기 프로젝트 열기: apache/lucenenet 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
EXPLAIN_SCORE_TOLERANCE_DELTA float
EXPLAIN_SCORE_TOLERANCE_MINIMUM float

공개 메소드들

메소드 설명
CheckDocIds ( string mes, int results, Lucene.Net.Search.ScoreDoc hits ) : void

Tests that a Hits has an expected order of documents

CheckEqual ( Query query, Lucene.Net.Search.ScoreDoc hits1, Lucene.Net.Search.ScoreDoc hits2 ) : void
CheckExplanations ( Query query, string defaultFieldName, IndexSearcher searcher ) : void

Asserts that the explanation value for every document matching a query corresponds with the true score.

CheckExplanations ( Query query, string defaultFieldName, IndexSearcher searcher, bool deep ) : void

Asserts that the explanation value for every document matching a query corresponds with the true score. Optionally does "deep" testing of the explanation details.

CheckHitCollector ( Random random, Query query, string defaultFieldName, IndexSearcher searcher, int results, Similarity similarity ) : void

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.

CheckHitsQuery ( Query query, Lucene.Net.Search.ScoreDoc hits1, Lucene.Net.Search.ScoreDoc hits2, int results ) : void

Tests that two queries have an expected order of documents, and that the two queries have the same score values.

CheckNoMatchExplanations ( Query q, string defaultFieldName, IndexSearcher searcher, int results ) : void

Tests that all documents up to maxDoc which are *not* in the expected result set, have an explanation which indicates that the document does not match

DoCheckHits ( Random random, Query query, string defaultFieldName, IndexSearcher searcher, int results, Similarity similarity ) : void

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.

ExplainToleranceDelta ( float f1, float f2 ) : float

returns a reasonable epsilon for comparing two floats, where minor differences are acceptable such as score vs. explain

Hits2str ( Lucene.Net.Search.ScoreDoc hits1, Lucene.Net.Search.ScoreDoc hits2, int start, int end ) : string
TopdocsString ( Lucene.Net.Search.TopDocs docs, int start, int end ) : string
VerifyExplanation ( string q, int doc, float score, bool deep, Explanation expl ) : void

Assert that an explanation has the expected score, and optionally that its sub-details max/sum/factor match to that score.

메소드 상세

CheckDocIds() 공개 정적인 메소드

Tests that a Hits has an expected order of documents
public static CheckDocIds ( string mes, int results, Lucene.Net.Search.ScoreDoc hits ) : void
mes string
results int
hits Lucene.Net.Search.ScoreDoc
리턴 void

CheckEqual() 공개 정적인 메소드

public static CheckEqual ( Query query, Lucene.Net.Search.ScoreDoc hits1, Lucene.Net.Search.ScoreDoc hits2 ) : void
query Query
hits1 Lucene.Net.Search.ScoreDoc
hits2 Lucene.Net.Search.ScoreDoc
리턴 void

CheckExplanations() 공개 정적인 메소드

Asserts that the explanation value for every document matching a query corresponds with the true score.
public static CheckExplanations ( Query query, string defaultFieldName, IndexSearcher searcher ) : void
query Query the query to test
defaultFieldName string used for displaing the query in assertion messages
searcher IndexSearcher the searcher to test the query against
리턴 void

CheckExplanations() 공개 정적인 메소드

Asserts that the explanation value for every document matching a query corresponds with the true score. Optionally does "deep" testing of the explanation details.
public static CheckExplanations ( Query query, string defaultFieldName, IndexSearcher searcher, bool deep ) : void
query Query the query to test
defaultFieldName string used for displaing the query in assertion messages
searcher IndexSearcher the searcher to test the query against
deep bool indicates whether a deep comparison of sub-Explanation details should be executed
리턴 void

CheckHitCollector() 공개 정적인 메소드

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.

public static CheckHitCollector ( Random random, Query query, string defaultFieldName, IndexSearcher searcher, int results, Similarity similarity ) : void
random System.Random
query Query the query to test
defaultFieldName string used for displaying the query in assertion messages
searcher IndexSearcher the searcher to test the query against
results int a list of documentIds that must match the query
similarity Similarity /// LUCENENET specific /// Removes dependency on ///
리턴 void

CheckHitsQuery() 공개 정적인 메소드

Tests that two queries have an expected order of documents, and that the two queries have the same score values.
public static CheckHitsQuery ( Query query, Lucene.Net.Search.ScoreDoc hits1, Lucene.Net.Search.ScoreDoc hits2, int results ) : void
query Query
hits1 Lucene.Net.Search.ScoreDoc
hits2 Lucene.Net.Search.ScoreDoc
results int
리턴 void

CheckNoMatchExplanations() 공개 정적인 메소드

Tests that all documents up to maxDoc which are *not* in the expected result set, have an explanation which indicates that the document does not match
public static CheckNoMatchExplanations ( Query q, string defaultFieldName, IndexSearcher searcher, int results ) : void
q Query
defaultFieldName string
searcher IndexSearcher
results int
리턴 void

DoCheckHits() 공개 정적인 메소드

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.

public static DoCheckHits ( Random random, Query query, string defaultFieldName, IndexSearcher searcher, int results, Similarity similarity ) : void
random System.Random
query Query the query to test
defaultFieldName string used for displaing the query in assertion messages
searcher IndexSearcher the searcher to test the query against
results int a list of documentIds that must match the query
similarity Similarity /// LUCENENET specific /// Removes dependency on ///
리턴 void

ExplainToleranceDelta() 공개 정적인 메소드

returns a reasonable epsilon for comparing two floats, where minor differences are acceptable such as score vs. explain
public static ExplainToleranceDelta ( float f1, float f2 ) : float
f1 float
f2 float
리턴 float

Hits2str() 공개 정적인 메소드

public static Hits2str ( Lucene.Net.Search.ScoreDoc hits1, Lucene.Net.Search.ScoreDoc hits2, int start, int end ) : string
hits1 Lucene.Net.Search.ScoreDoc
hits2 Lucene.Net.Search.ScoreDoc
start int
end int
리턴 string

TopdocsString() 공개 정적인 메소드

public static TopdocsString ( Lucene.Net.Search.TopDocs docs, int start, int end ) : string
docs Lucene.Net.Search.TopDocs
start int
end int
리턴 string

VerifyExplanation() 공개 정적인 메소드

Assert that an explanation has the expected score, and optionally that its sub-details max/sum/factor match to that score.
public static VerifyExplanation ( string q, int doc, float score, bool deep, Explanation expl ) : void
q string String representation of the query for assertion messages
doc int Document ID for assertion messages
score float Real score value of doc with query q
deep bool indicates whether a deep comparison of sub-Explanation details should be executed
expl Explanation The Explanation to match against score
리턴 void

프로퍼티 상세

EXPLAIN_SCORE_TOLERANCE_DELTA 공개적으로 정적으로 프로퍼티

Some explains methods calculate their values though a slightly different order of operations from the actual scoring method ... this allows for a small amount of relative variation
public static float EXPLAIN_SCORE_TOLERANCE_DELTA
리턴 float

EXPLAIN_SCORE_TOLERANCE_MINIMUM 공개적으로 정적으로 프로퍼티

In general we use a relative epsilon, but some tests do crazy things like boost documents with 0, creating tiny tiny scores where the relative difference is large but the absolute difference is tiny. we ensure the the epsilon is always at least this big.
public static float EXPLAIN_SCORE_TOLERANCE_MINIMUM
리턴 float