[
https://issues.apache.org/jira/browse/SOLR-10047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15956712#comment-15956712
]
Shalin Shekhar Mangar edited comment on SOLR-10047 at 4/5/17 11:49 AM:
-----------------------------------------------------------------------
Thanks Keith.
* I merged the pull request to latest master to try this out locally and the
UninvertingDirectoryReaderMappingPerSegment requires an implementation of
IndexReader#getReaderCacheHelper method which was added to IndexReader in
LUCENE-7410
* I find the javadocs for UninvertingDirectoryReaderMappingPerSegment a little
confusing. I made an attempt to rewrite them to convey the intention and
implementation better. Use if you see fit:
{code}
* If docvalues are enabled or disabled after data has already been indexed
for a field, such that
* only some segments have docvalues, uninverting on the top level reader
will cause
* IllegalStateException to be thrown when trying to use a field with such
mixed data. This is because
* the {@link IndexSchema#getUninversionMap(IndexReader)} method decides to
put a field
* into the uninverteding map only if *NO* segment in the index contains
docvalues for that field.
*
* Therefore, this class provides a uninverting map per segment such that for
any field,
* DocValues are used from segments if they exist and uninversion of the
field is performed on the rest
* of the segments.
{code}
* Perhaps we can rename UninvertingDirectoryReaderMappingPerSegment to
PerSegmentUninvertingDirectoryReader or
UninvertingDirectoryReaderPerSegmentMapping?
The rest of the changes looks good to me.
was (Author: shalinmangar):
Thanks Keith.
* I merged the pull request to latest master to try this out locally and the
UninvertingDirectoryReaderMappingPerSegment requires an implementation of
IndexReader#getReaderCacheHelper method which was added to IndexReader in
LUCENE-7410
* I find the javadocs for UninvertingDirectoryReaderMappingPerSegment a little
confusing. I made an attempt to rewrite them to convey the intention and
implementation better. Use if you see fit:
{code}
* The decision to uninvert a field is made when *NO* segment in the index
contains docvalues
* for that field otherwise the field is not added to the uninverting map for
use with the
* UninvertingReader
*
* If docvalues are enabled or disabled after data has already been indexed
for a field, such that
* only some segments have docvalues, uninverting on the top level reader
will cause
* IllegalStateException to be thrown when trying to use a field with such
mixed data. This is because
* the {@link IndexSchema#getUninversionMap(IndexReader)} method decides to
put a field
* into the uninverteding map only if *NO* segment in the index contains
docvalues for that field.
*
* Therefore, this class provides a uninverting map per segment such that for
any field,
* DocValues are used from segments if they exist and uninversion of the
field is performed on the rest
* of the segments.
{code}
* Perhaps we can rename UninvertingDirectoryReaderMappingPerSegment to
PerSegmentUninvertingDirectoryReader or
UninvertingDirectoryReaderPerSegmentMapping?
The rest of the changes looks good to me.
> Mismatched Docvalue segments cause exception in Sorting/Facting; Uninvert per
> segment
> -------------------------------------------------------------------------------------
>
> Key: SOLR-10047
> URL: https://issues.apache.org/jira/browse/SOLR-10047
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Reporter: Keith Laban
>
> The configuration of UninvertingReader in SolrIndexSearch creates a global
> mapping for the directory for fields to uninvert. If docvalues are enabled on
> a field the creation of a new segment will cause the query to fail when
> faceting/sorting on the recently docvalue enabled field. This happens because
> the UninvertingReader is configured globally across the entire directory, and
> a single segment containing DVs for a field will incorrectly indicate that
> all segments contain DVs.
> This patch addresses the incorrect behavior by determining the fields to be
> uninverted on a per-segment basis.
> With the fix, it is still recommended that a reindexing occur as data loss
> will when a DV and non-DV segment are merged, SOLR-10046 addresses this
> behavior. This fix is to be a stop gap for the time between enabling
> docvalues and the duration of a reindex.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]