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

Based on SimpleFacetedSearch. Uses DocID lists instead on bitmaps. Efficient memory usage for high cardinality sparsely populated facets.

Suitable for high cardinality, sparsely populated facets. i.e. There are a large number of facet values and each facet value is hit in a small percentage of documents. Especially if there are also a large number of documents. SimpleFacetedSearch holds a bitmap for each value representing whether that value is a hit is each document (approx 122KB per 1M documents per facet value). So this is an O(N*M) problem. The memory requirement can grow very quickly.

SparseFacetedSearcher records the DocID (Int32) for each value hit (memory cost = values * hits * 4). SimpleFacetedSearch record a bit for evey document per value (memory cost = values * documents / 8). So if the average number of hits for each value is less than 1/32 or 3.125% then Sparse is more memory efficient.

There are also some enumerable methods than mean there is much less pressure on the GC. Plus some bug fixes.

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

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

Свойство Тип Описание
MAX_FACETS int

Открытые методы

Метод Описание
Count ( Query query = null, int maxDocPerGroup = DefaultMaxDocPerGroup ) : FacetCountResult
Search ( Query query = null, int maxDocPerGroup = DefaultMaxDocPerGroup ) : FacetSearchResult
SparseFacetedSearcher ( IndexReader reader ) : System

Приватные методы

Метод Описание
SearchInternal ( Query query = null, int maxDocPerGroup = DefaultMaxDocPerGroup ) : IEnumerable

Описание методов

Count() публичный Метод

public Count ( Query query = null, int maxDocPerGroup = DefaultMaxDocPerGroup ) : FacetCountResult
query Query
maxDocPerGroup int
Результат FacetCountResult

Search() публичный Метод

public Search ( Query query = null, int maxDocPerGroup = DefaultMaxDocPerGroup ) : FacetSearchResult
query Query
maxDocPerGroup int
Результат FacetSearchResult

SparseFacetedSearcher() публичный Метод

public SparseFacetedSearcher ( IndexReader reader ) : System
reader Lucene.Net.Index.IndexReader
Результат System

Описание свойств

MAX_FACETS публичное статическое свойство

public static int MAX_FACETS
Результат int