0
votes

I understand the theory concepts of Inverted index and indexes. Primarily, Solr indexes documents using inverted index (Searching tokens instead of documents).
I've also read that Solr uses indexing for features such as facets.
As I understand it, for facets, searching for a term and creating facets require Solr to search all the terms in a field and match all the retrieved documents containing the search term, which will be costly, so indexing is used.

From what I understand, index is used when all the documents referring to the search terms are retrieved, they are traversed and a count of unique values regarding the fields are calculated.

Is this a correct understanding of this concept or there is something else ?

1

1 Answers

1
votes

The is not only one way, how faceting in solr works. Solr has a heuristic to select a best but there is also a the facet.method parameter to select it by your own.

Mainly your description is right, but solr is fast because of caching the UnInvertedField instead of selecting the values for each request from the inverted index.

With DocValues there is also an efficient storage of an uninverted field.

Possible also this answers will help you: