lucene-dev mailing list archives

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

    [ https://issues.apache.org/jira/browse/LUCENE-7659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15838861#comment-15838861
] 

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:
{code}
+    synchronized Set<String> getFieldNames() {
+      return Collections.unmodifiableSet(new HashSet<>(nameToNumber.keySet()));
+    }
{code}

> IndexWriter should expose field names
> -------------------------------------
>
>                 Key: LUCENE-7659
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7659
>             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
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message