C# Класс Lucene.Net.Search.CheckHits

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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