<?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>delete &#8211; Solr.pl</title>
	<atom:link href="https://solr.pl/en/tag/delete/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 08:17:05 +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>Index &#8211; delete or update?</title>
		<link>https://solr.pl/en/2011/02/16/index-delete-or-update/</link>
					<comments>https://solr.pl/en/2011/02/16/index-delete-or-update/#respond</comments>
		
		<dc:creator><![CDATA[Rafał Kuć]]></dc:creator>
		<pubDate>Wed, 16 Feb 2011 08:16:33 +0000</pubDate>
				<category><![CDATA[Solr]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[solr]]></category>
		<guid isPermaLink="false">http://sematext.solr.pl/?p=213</guid>

					<description><![CDATA[From time to time, in working with Solr there is a problem &#8211; how to update Solr index structure. There are various reasons for these changes &#8211; the new functional requirements, optimization, or anything else &#8211; it is not important.]]></description>
										<content:encoded><![CDATA[<p>From time to time, in working with Solr there is a problem &#8211; how to update Solr index structure. There  are various reasons for these changes &#8211; the new functional  requirements, optimization, or anything else &#8211; it is not important. What  is important is the question that arise &#8211; should we remove the index,  or simply change the structure and do a full indexing? Contrary to appearances, the answer to this question depends on the changes we made in the structure of the index.</p>
<p><span id="more-213"></span></p>
<p><img decoding="async" title="Więcej..." src="../wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt=""></p>
<p>Personally, I am an advocate of solutions that have the smallest chance to cause problems &#8211; I just like to sleep at night. I  think that removing the index after updateing its structure and then do  the full indexation of the data is one of those solutions, at least in  my opinion. I am aware, however, that this type of solution is not always acceptable. So when we are not forced to remove the index, and when not doing it exposes us to potential problems with the Solr ?</p>
<p>The answer to the question depends on what changed in the structure of the index. Such changes can be divided into three areas covering most of the changes that we make in the structure of the index:</p>
<ul>
<li><strong>Adding / removing new field</strong></li>
<li><strong>Similarity modification<br />
</strong></li>
<li><strong>Field modification<br />
</strong></li>
</ul>
<h3>Adding / removing new field</h3>
<p>In the case of the first type of modification of the matter is quite simple &#8211; if we <strong>add or remove a new field</strong> to <em>schema.xml</em> there is no need to remove the entire index before re-indexing. Solr handle adding a new field to the current index. Of  course, you should be aware that the documents which will not be after  this operation will not be re-indexed automatically updated.</p>
<h3>Similarity modification</h3>
<p>In  the second case &#8211; the change of the class that is responsible for <em> Similarity </em>also does not force us to to delete the index after the  change. But  unlike the previous example, if we want Solr to correctly calculate&nbsp; the <em>score</em>, and thus to sort in the correct order we will be forced to re-indexing of  all documents previously present in the index.</p>
<h3>Field modification</h3>
<p>Let stop a minute on the third case. Let&#8217;s  suppose that we modify slightly the field in the index with the prosaic  reason &#8211; we are no longer interested in the normalization of its  length. We set <em>omitNorms=&#8221;true&#8221;</em> (I assume that the previous setting was <em>omitNorms=&#8221;false&#8221;</em>). If  we only re-index all the documents, the Lucene indexes, in the combined  segments, will still have information about length normalization of the  field. Something went wrong. This  is precisely the case when it is necessary to delete the index after  the change to its structure, and prior to full indexation. At first glance, it seems that this is a very small change, but thinking further, we have some side effects of the change.  It  is worth remembering that some of the field properties are overwritten  by other, as in the case of normalization of the length &#8211; if one segment  will have lenght normalization, and the second will not, when you  combine the segments you will have lenght normalization in the one that  was created.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://solr.pl/en/2011/02/16/index-delete-or-update/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
