lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien Grand (JIRA)" <>
Subject [jira] [Commented] (LUCENE-7659) IndexWriter should expose field names
Date Thu, 26 Jan 2017 00:02:26 GMT


Adrien Grand commented on LUCENE-7659:

I think this change is not thread-safe? It currently returns a view ({{Map.keySet()}}) of
the field numbers map which may be written to at any time by {{IndexWriter}}, I think it should
rather take a snapshot under the lock? Ie. something like this:
+    synchronized Set<String> getFieldNames() {
+      return Collections.unmodifiableSet(new HashSet<>(nameToNumber.keySet()));
+    }

> IndexWriter should expose field names
> -------------------------------------
>                 Key: LUCENE-7659
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Ishan Chattopadhyaya
>            Assignee: Ishan Chattopadhyaya
>         Attachments: LUCENE-7659.patch, LUCENE-7659.patch, LUCENE-7659.patch
> While working on SOLR-5944, I needed a way to know whether applying an update to a DV
is possible (i.e. the DV exists or not), while deciding upon whether or not to apply the update
as an in-place update or a regular full document update. This information is present at the
IndexWriter in a FieldInfos instance, and can be exposed.

This message was sent by Atlassian JIRA

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

View raw message