lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] [Commented] (LUCENE-8441) Wrong index sort field type throws unexpected NullPointerException
Date Wed, 01 Aug 2018 14:42:00 GMT


Michael McCandless commented on LUCENE-8441:

+1, thanks for fixing so quickly [~jim.ferenczi]!

We could maybe improve the new per-DV-field-per-document check so that instead of doing a
for loop over all index sort fields, we add a new member to the {{PerField}} in {{DefaultIndexingChain}}
e.g. {{requiredDocValuesSortFieldType}} or so?  So we would do that for loop through all
index sort fields only when creating a new {{PerField}} (first time this in-memory segment
sees this field being indexed).

If that is non-null (meaning that field was included in the index sort), we check that it's
the same type as what the user is now trying to index?

But this can come later ... it's just a small performance improvement over the functionally
correct patch you created.  Thanks!

> Wrong index sort field type throws unexpected NullPointerException
> ------------------------------------------------------------------
>                 Key: LUCENE-8441
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-8441.patch, LUCENE-8441.patch
> I came across this scary exception if you pass the wrong {{SortField.Type}} for a field;
I'll attach patch w/ small test case:
> {noformat}
> 1) testWrongSortFieldType(org.apache.lucene.index.TestIndexSorting)
> java.lang.NullPointerException
>         at __randomizedtesting.SeedInfo.seed([995FF58C7B184E8F:B0CC507647B2ED95]:0)
>         at org.apache.lucene.index.SortingTermVectorsConsumer.abort(
>         at org.apache.lucene.index.TermsHash.abort(
>         at org.apache.lucene.index.DefaultIndexingChain.abort(
>         at org.apache.lucene.index.DocumentsWriterPerThread.abort(
>         at org.apache.lucene.index.DocumentsWriterPerThread.maybeAbort(
>         at org.apache.lucene.index.DocumentsWriterPerThread.flush(
>         at org.apache.lucene.index.DocumentsWriter.doFlush(
>         at org.apache.lucene.index.DocumentsWriter.flushAllThreads(
>         at org.apache.lucene.index.IndexWriter.prepareCommitInternal(
>         at org.apache.lucene.index.IndexWriter.commitInternal(
>         at org.apache.lucene.index.IndexWriter.commit(
>         at org.apache.lucene.index.TestIndexSorting.testWrongSortFieldType(
> {noformat}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message