You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Otis Gospodnetic <ot...@gmail.com> on 2013/11/16 08:39:04 UTC

Adding DocValues after or in the middle of indexing

Hi,

Can one introduce DocValues (by adding them to the schema.xml) post facto?
If that is done, do newly added documents end up using DocValues,
while the old ones remain without DocValues?

Thanks,
Otis
--
Performance Monitoring * Log Analytics * Search Analytics
Solr & Elasticsearch Support * http://sematext.com/

Re: Adding DocValues after or in the middle of indexing

Posted by Shawn Heisey <so...@elyograg.org>.
On 11/16/2013 12:39 AM, Otis Gospodnetic wrote:
> Can one introduce DocValues (by adding them to the schema.xml) post facto?
> If that is done, do newly added documents end up using DocValues,
> while the old ones remain without DocValues?

Short answer: You need to reindex.

Long answer:

That would very likely cause some big problems for sorting and facets.
Without docValues, sorting and facets use the indexed field.  With
docValues, these features will use docValues instead, because
performance is typically better.

Prior to Solr 4.5, docValues required that every document have a value
for the field.  Because some of the docs would not have anything in
docValues, exceptions might be thrown on these older versions if you use
sorting or facets.  I have not tried it, but it seems likely.  This
assumes of course that these older versions don't just throw an
exception at core startup because the existing segments are missing the
files for docValues.

Solr 4.5 eliminated the limitation described above, so exceptions are
less likely.  Unfortunately results from sorting or facets would likely
be incorrect, because only a subset of the documents would have
docValues data.  If the older versions do somehow manage to avoid
exceptions, they would likely also produce incorrect results.

Thanks,
Shawn