<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>document cache &#8211; Solr.pl</title>
	<atom:link href="https://solr.pl/en/tag/document-cache-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://solr.pl/en/</link>
	<description>All things to be found - Blog related to Apache Solr &#38; Lucene projects - https://solr.apache.org</description>
	<lastBuildDate>Wed, 11 Nov 2020 20:48:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Optimization &#8211; document cache</title>
		<link>https://solr.pl/en/2011/08/29/optimization-document-cache/</link>
					<comments>https://solr.pl/en/2011/08/29/optimization-document-cache/#respond</comments>
		
		<dc:creator><![CDATA[Rafał Kuć]]></dc:creator>
		<pubDate>Mon, 29 Aug 2011 19:48:04 +0000</pubDate>
				<category><![CDATA[Solr]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[document]]></category>
		<category><![CDATA[document cache]]></category>
		<category><![CDATA[documentCache]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[solr]]></category>
		<guid isPermaLink="false">http://sematext.solr.pl/?p=366</guid>

					<description><![CDATA[A few months ago (here) we looked at filterCache. I&#8217;ve decided to update the optimization topic and take a look at the documentCache. What it contains ? So let&#8217;s start with information about the information that documentCache holds. So documentCache]]></description>
										<content:encoded><![CDATA[<p>A few months ago (<a href="http://solr.pl/en/2011/02/07/optimization-filter-cache/" target="_blank" rel="noopener noreferrer">here</a>) we looked at <em>filterCache</em>. I&#8217;ve decided to update the optimization topic and take a look at the <em>documentCache</em>.</p>
<p><span id="more-366"></span></p>
<h3>What it contains ?</h3>
<p>So let&#8217;s start with information about the information that <em>documentCache </em>holds. So <em>documentCache</em> contain Lucene documents that were fetched from the index. So little and so much.</p>
<h3>What it is used for ?</h3>
<p>Every object (Lucene document) stored in <em>documentCache</em> contains a list of references to the fields, that are stored with the document. Thanks to this, when a document is fetched and put into the cache it doesn&#8217;t have to be fetched again while processing another query. And this is why the number of I/O operations is reduces when rendering the query results list.</p>
<h3>What to remember when using documentCache ?</h3>
<p>When using <em>documentCache</em> you have to remember about to important things:</p>
<ol>
<li><em>documentCache</em> can&#8217;t be autowarmed because it operates on identifiers that change after every <em>commit </em>operation.</li>
<li>If you use lazy field loading (<em>enableLazyFieldLoading=true</em>) <em>documentCache</em> functionality is somehow limited. This means that the document stored in the <em>documentCache</em> will contain only those fields that were passed to the <em>fl </em>parameter. If the next query will try to get additional fields for the document stored in the cache, those additional fields will be fetched from the index.</li>
</ol>
<h3>Definition</h3>
<p>The standard <em>documentCache </em>definition looks like this:
</p>
<pre class="brush:xml">&lt;documentCache
      class="solr.FastLRUCache"
      size="16384"
      initialSize="16384"/&gt;</pre>
<p>Let&#8217;s recall those parameters:</p>
<ul>
<li><em>class</em> &#8211; class implementing the cache,</li>
<li><em>size</em> &#8211; the maximum cache size,</li>
<li><em>initialSize</em> &#8211; initial size of the cache.</li>
</ul>
<h3>How to configure ?</h3>
<p>The usual question about cache &#8211; what size should I set ? According to the information from Solr wiki (<a href="http://wiki.apache.org/solr/SolrCaching#documentCache" target="_blank" rel="noopener noreferrer">http://wiki.apache.org/solr/SolrCaching#documentCache</a>), the maximum size shouldn&#8217;t be less than the product of concurrent queries and the maximum number of documents fetched by the query. A simple relation that should ensure that Solr won&#8217;t have to fetch documents from the index during query processing.</p>
<h3>Last few words</h3>
<p>In the case of <em>documentCache</em> we don&#8217;t have to worry about how we construct our queries to properly use this cache. But please remember that <em>documentCache</em> requires memory, the more memory, the more field you stored in the index.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://solr.pl/en/2011/08/29/optimization-document-cache/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
