Apache Lucene.Net 2.4.0 Class Library API

Lucene.Net.Search Namespace

Namespace hierarchy

Classes

Class Description
AnonymousClassScoreDocComparator  
AnonymousClassScoreDocComparator1  
BooleanClause A clause in a BooleanQuery.
BooleanClause.Occur Specifies how clauses are to occur in matching documents.
BooleanQuery A Query that matches documents matching boolean combinations of other queries, e.g. {@link TermQuery}s, {@link PhraseQuery}s or other BooleanQuerys.
BooleanQuery.TooManyClauses Thrown when an attempt is made to add more than {@link #GetMaxClauseCount()} clauses. This typically happens if a PrefixQuery, FuzzyQuery, WildcardQuery, or RangeQuery is expanded to many terms during search.
CachingSpanFilter Wraps another SpanFilter's result and caches it. The purpose is to allow filters to simply filter, and then wrap with this class to add caching.
CachingWrapperFilter Wraps another filter's result and caches it. The purpose is to allow filters to simply filter, and then wrap with this class to add caching.
ComplexExplanation Expert: Describes the score computation for document and query, and can distinguish a match independent of a positive value.
ConstantScoreQuery A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter.
ConstantScoreQuery.ConstantScorer  
ConstantScoreQuery.ConstantWeight  
ConstantScoreRangeQuery  
DefaultSimilarity Expert: Default scoring implementation.
DisjunctionMaxQuery A query that generates the union of documents produced by its subqueries, and that scores each document with the maximum score for that document as produced by any subquery, plus a tie breaking increment for any additional matching subqueries. This is useful when searching for a word in multiple fields with different boost factors (so that the fields cannot be combined equivalently into a single search field). We want the primary score to be the one associated with the highest boost, not the sum of the field scores (as BooleanQuery would give). If the query is "albino elephant" this ensures that "albino" matching one field and "elephant" matching another gets a higher score than "albino" matching both fields. To get this result, use both BooleanQuery and DisjunctionMaxQuery: for each term a DisjunctionMaxQuery searches for it in each field, while the set of these DisjunctionMaxQuery's is combined into a BooleanQuery. The tie breaker capability allows results that include the same term in multiple fields to be judged better than results that include this term in only the best of those multiple fields, without confusing this with the better case of two different terms in the multiple fields.
DocIdSet A DocIdSet contains a set of doc ids. Implementing classes must provide a DocIdSetIterator to access the set.
DocIdSetIterator  
Explanation Expert: Describes the score computation for document and query.
ExtendedFieldCacheImpl
ExtendedFieldCacheImpl.AnonymousClassDoubleParser  
ExtendedFieldCacheImpl.AnonymousClassLongParser  
FieldCacheImpl Expert: The default cache implementation, storing all values in memory. A WeakHashMap is used for storage.
FieldCacheImpl.AnonymousClassByteParser  
FieldCacheImpl.AnonymousClassFloatParser  
FieldCacheImpl.AnonymousClassIntParser  
FieldCacheImpl.AnonymousClassShortParser  
FieldDoc Expert: A ScoreDoc which also contains information about how to sort the referenced document. In addition to the document number and score, this object contains an array of values for the document from the field(s) used to sort. For example, if the sort criteria was to sort by fields "a", "b" then "c", the
fields
object array will have three elements, corresponding respectively to the term values for the document in fields "a", "b" and "c". The class of each element in the array will be either Integer, Float or String depending on the type of values in the terms of each field.
FieldSortedHitQueue Expert: A hit queue for sorting by hits by terms in more than one field. Uses
FieldCache.DEFAULT
for maintaining internal term lookup tables.
Filter Abstract base class providing a mechanism to limit index search results to a subset of an index.

Note: In Lucene 3.0, Bits(IndexReader) will be removed and GetDocIdSet(IndexReader) will be made abstract. All implementin classes must therefore implement GetDocIdSet(IndexReader) in order to work with Lucene 3.0.

FilteredQuery A query that applies a filter to the results of another query.

Note: the bits are retrieved from the filter each time this query is used in a search - use a CachingWrapperFilter to avoid regenerating the bits every time.

FilteredTermEnum  
FilterManager Filter caching singleton. It can be used by {@link Lucene.Net.Search.RemoteCachingWrapperFilter} or just to save filters locally for reuse. This class makes it possble to cache Filters even when using RMI, as it keeps the cache on the seaercher side of the RMI connection. Also could be used as a persistent storage for any filter as long as the filter provides a proper hashCode(), as that is used as the key in the cache. The cache is periodically cleaned up from a separate thread to ensure the cache doesn't exceed the maximum size.
FilterManager.FilterCleaner Keeps the cache from getting too big. If we were using Java 1.5, we could use LinkedHashMap and we would not need this thread to clean out the cache. The SortedSet sortedFilterItems is used only to sort the items from the cache, so when it's time to clean up we have the TreeSet sort the FilterItems by timestamp. Removes 1.5 * the numbers of items to make the cache smaller. For example: If cache clean size is 10, and the cache is at 15, we would remove (15 - 10) * 1.5 = 7.5 round up to 8. This way we clean the cache a bit more, and avoid having the cache cleaner having to do it frequently.
FilterManager.FilterItem Holds the filter and the last time the filter was used, to make LRU-based cache cleaning possible. TODO: Clean this up when we switch to Java 1.5
FuzzyQuery Implements the fuzzy search query. The similiarity measurement is based on the Levenshtein (edit distance) algorithm.
FuzzyQuery.ScoreTerm  
FuzzyQuery.ScoreTermQueue  
FuzzyTermEnum  
Hit Obsolete. Wrapper used by {@link HitIterator} to provide a lazily loaded hit from {@link Hits}.
HitCollector  
HitIterator Obsolete. An iterator over {@link Hits} that provides lazy fetching of each document. {@link Hits#Iterator()} returns an instance of this class. Calls to {@link #Next()} return a {@link Hit} instance.
Hits Obsolete.  
IndexSearcher  
MatchAllDocsQuery A query that matches all documents.
MultiPhraseQuery MultiPhraseQuery is a generalized version of PhraseQuery, with an added method {@link #Add(Term[])}. To use this class, to search for the phrase "Microsoft app*" first use add(Term) on the term "Microsoft", then find all terms that have "app" as prefix using IndexReader.terms(Term), and use MultiPhraseQuery.add(Term[] terms) to add them to the query.
MultiSearcher  
MultiTermQuery  
ParallelMultiSearcher  
PhraseQuery  
PrefixFilter
PrefixQuery A Query that matches documents containing terms with a specified prefix. A PrefixQuery is built by QueryParser for input like
app*
.
Query  
QueryFilter Constrains search results to only match those which also match a provided query. Results are cached, so that searches after the first on the same index using this filter are much faster.
QueryTermVector
QueryWrapperFilter  
RangeFilter A Filter that restricts search results to a range of values in a given field.

This code borrows heavily from {@link RangeQuery}, but is implemented as a Filter

RangeQuery A Query that matches documents within an exclusive range. A RangeQuery is built by QueryParser for input like
[010 TO 120]
but only if the QueryParser has the useOldRangeQuery property set to true. The QueryParser default behaviour is to use the newer ConstantScoreRangeQuery class. This is generally preferable because:
  • It is faster than RangeQuery
  • Unlike RangeQuery, it does not cause a BooleanQuery.TooManyClauses exception if the range of values is large
  • Unlike RangeQuery it does not influence scoring based on the scarcity of individual terms that may match
RemoteCachingWrapperFilter Provides caching of {@link Filter}s themselves on the remote end of an RMI connection. The cache is keyed on Filter's hashCode(), so if it sees the same filter twice it will reuse the original version.

NOTE: This does NOT cache the Filter bits, but rather the Filter itself. Thus, this works hand-in-hand with {@link CachingWrapperFilter} to keep both file Filter cache and the Filter bits on the remote end, close to the searcher.

Usage:

To cache a result you must do something like RemoteCachingWrapperFilter f = new RemoteCachingWrapperFilter(new CachingWrapperFilter(myFilter));

RemoteSearchable A remote searchable implementation.
ReqExclScorer  
ReqOptSumScorer  
ScoreDoc Expert: Returned by low-level search implementations.
Scorer Expert: Common scoring functionality for different types of queries.

A

Scorer
either iterates over documents matching a query in increasing order of doc Id, or provides an explanation of the score for a query for a given document.

Document scores are computed using a given

Similarity
implementation.

Searcher  
Similarity  
SimilarityDelegator Expert: Delegating scoring implementation. Useful in {@link Query#GetSimilarity(Searcher)} implementations, to override only certain methods of a Searcher's Similiarty implementation..
Sort  
SortComparator  
SortField Stores information about how to sort documents by terms in an individual field. Fields must be indexed in order to sort by them.
SpanFilter Abstract base class providing a mechanism to restrict searches to a subset of an index and also maintains and returns position information. This is useful if you want to compare the positions from a SpanQuery with the positions of items in a filter. For instance, if you had a SpanFilter that marked all the occurrences of the word "foo" in documents, and then you entered a new SpanQuery containing bar, you could not only filter by the word foo, but you could then compare position information for post processing.
SpanFilterResult The results of a SpanQueryFilter. Wraps the BitSet and the position infomration from the SpanQuery

NOTE: This API is still experimental and subject to change.
SpanFilterResult.PositionInfo  
SpanFilterResult.StartEnd  
SpanQueryFilter Constrains search results to only match those which also match a provided query. Also provides position information about where each document matches at the cost of extra space compared with the QueryWrapperFilter. There is an added cost to this above what is stored in a {@link QueryWrapperFilter}. Namely, the position information for each matching document is stored.

This filter does not cache. See the {@link Lucene.Net.Search.CachingSpanFilter} for a wrapper that caches.
StringIndex Expert: Maintains caches of term values.
TermQuery A Query that matches documents containing a term. This may be combined with other terms with a {@link BooleanQuery}.
TermScorer Expert: A
Scorer
for documents matching a
Term
.
TimeLimitedCollector  
TimeLimitedCollector.TimeExceededException  
TopDocCollector  
TopDocs Expert: Returned by low-level search implementations.
TopFieldDocCollector  
TopFieldDocs Expert: Returned by low-level sorted search implementations.
WildcardQuery Implements the wildcard search query. Supported wildcards are
*
, which matches any character sequence (including the empty one), and
?
, which matches any single character. Note this query can be slow, as it needs to iterate over many terms. In order to prevent extremely slow WildcardQueries, a Wildcard term should not start with one of the wildcards
*
or
?
.
WildcardTermEnum  

Interfaces

Interface Description
ByteParser Interface to parse bytes from document fields.
DoubleParser  
ExtendedFieldCache  
FieldCache  
FloatParser Interface to parse floats from document fields.
IntParser Interface to parse ints from document fields.
LongParser  
ScoreDocComparator  
Searchable  
ShortParser Interface to parse shorts from document fields.
SortComparatorSource  
Weight  

Structures

Structure Description
ExtendedFieldCache_Fields
FieldCache_Fields  
ScoreDocComparator_Fields Expert: Compares two ScoreDoc objects for sorting.