11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

number A Velocity NumberTool instance<br />

sort A Velocity SortTool instance<br />

display A Velocity DisplayTool instance<br />

resource A Velocity ResourceTool instance<br />

engine<br />

page<br />

debug<br />

content<br />

[custom<br />

tool(s)]<br />

The current VelocityEngine instance<br />

An instance of <strong>Solr</strong>'s PageTool (only included if the response is a QueryResponse where paging<br />

makes sense)<br />

A shortcut to the debug part of the response, or null if debug is not on. This is handy for having<br />

debug-only sections in a template using #if($debug)...#end<br />

The rendered output of the main template, when rendering the layout (v.layout.enabled=true and<br />

v.layout=).<br />

Tools provided by the optional "tools" list of the VelocityResponseWriter registration are available<br />

by their specified name.<br />

Near Real Time Searching<br />

Near Real Time (NRT) search means that documents are available for search almost immediately after being<br />

indexed: additions and updates to documents are seen in 'near' real time. <strong>Solr</strong> does not block updates while a<br />

commit is in progress. Nor does it wait for background merges to complete before opening a new search of<br />

indexes and returning.<br />

With NRT, you can modify a commit command to be a soft commit, which avoids parts of a standard commit<br />

that can be costly. You will still want to do standard commits to ensure that documents are in stable storage, but<br />

soft commits let you see a very near real time view of the index in the meantime. However, pay special<br />

attention to cache and autowarm settings as they can have a significant impact on NRT performance.<br />

Commits and Optimizing<br />

A commit operation makes index changes visible to new search requests. A hard commit uses the transaction<br />

log to get the id of the latest document changes, and also calls fsync on the index files to ensure they have<br />

been flushed to stable storage and no data loss will result from a power failure.<br />

A soft commit is much faster since it only makes index changes visible and does not fsync index files or write<br />

a new index descriptor. If the JVM crashes or there is a loss of power, changes that occurred after the last hard<br />

commit will be lost. Search collections that have NRT requirements (that want index changes to be quickly<br />

visible to searches) will want to soft commit often but hard commit less frequently. A softCommit may be "less<br />

expensive" in terms of time, but not free, since it can slow throughput.<br />

An optimize is like a hard commit except that it forces all of the index segments to be merged into a single<br />

segment first. Depending on the use, this operation should be performed infrequently (e.g., nightly), if at all, since<br />

it involves reading and re-writing the entire index. Segments are normally merged over time anyway (as<br />

determined by the merge policy), and optimize just forces these merges to occur immediately.<br />

Soft commit takes uses two parameters: maxDocs and maxTime.<br />

Parameter<br />

Description<br />

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

400

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

Saved successfully!

Ooh no, something went wrong!