11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

the filterCache will be checked for a filter matching the query. For most situations, this is only useful if the<br />

same search is requested often with different sort options and none of them ever use "score".<br />

true<br />

queryResultWindowSize<br />

Used with the queryResultCache, this will cache a superset of the requested number of document IDs. For<br />

example, if the a search in response to a particular query requests documents 10 through 19, and queryWindo<br />

wSize is 50, documents 0 through 49 will be cached.<br />

20<br />

queryResultMaxDocsCached<br />

This parameter sets the maximum number of documents to cache for any entry in the queryResultCache.<br />

200<br />

useColdSearcher<br />

This setting controls whether search requests for which there is not a currently registered searcher should wait<br />

for a new searcher to warm up (false) or proceed immediately (true). When set to "false", requests will block until<br />

the searcher has warmed its caches.<br />

false<br />

maxWarmingSearchers<br />

This parameter sets the maximum number of searchers that may be warming up in the background at any given<br />

time. Exceeding this limit will raise an error. For read-only slaves, a value of two is reasonable. Masters should<br />

probably be set a little higher.<br />

2<br />

Query-Related Listeners<br />

As described in the section on Caches, new Index Searchers are cached. It's possible to use the triggers for<br />

listeners to perform query-related tasks. The most common use of this is to define queries to further "warm" the<br />

Index Searchers while they are starting. One benefit of this approach is that field caches are pre-populated for<br />

faster sorting.<br />

Good query selection is key with this type of listener. It's best to choose your most common and/or heaviest<br />

queries and include not just the keywords used, but any other parameters such as sorting or filtering requests.<br />

There are two types of events that can trigger a listener. A firstSearcher event occurs when a new searcher<br />

is being prepared but there is no current registered searcher to handle requests or to gain auto-warming data<br />

from (i.e., on <strong>Solr</strong> startup). A newSearcher event is fired whenever a new searcher is being prepared and there<br />

is a current searcher handling requests.<br />

The (commented out) examples below can be found in the solrconfig.xml file of the sample_techproduct<br />

s_configs config set included with <strong>Solr</strong>, and demonstrate using the solr.QuerySenderListener class to<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

455

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!