You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ishan Chattopadhyaya <ic...@gmail.com> on 2016/07/01 16:33:01 UTC

Obtain list of indexed fields from IndexWriter

Hi,
If an update to a non-existent dv field is attempted, IndexWriter throws an
exception:
"can only update existing numeric-docvalues fields!".

This exception is thrown after checking with the globalFieldNumberMap
(which is obtained from the SegmentInfos).

Is there a way, given an IndexWriter instance, I can obtain a list of
fields that have been indexed through this writer (so that I can check
before attempting to update a non-existing DV field)? In absence of
something that I'm missing that exists already, is it possible to expose
either the segmentInfos or the globalFieldNumberMap as a public API?

Regards,
Ishan