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

Robert Muir commented on LUCENE-10291:
--------------------------------------

Also, test should make sure a merge happens as well. You can see SegmentMerger 
doesn't guard mergePostings() based upon what it sees in fieldinfos (vectors, 
term vectors, docvalues are all checking fieldinfos for this). So the postings 
are treated different here, too.

> Only read/write postings when there is at least one indexed field
> -----------------------------------------------------------------
>
>                 Key: LUCENE-10291
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10291
>             Project: Lucene - Core
>          Issue Type: Task
>            Reporter: Adrien Grand
>            Priority: Minor
>
> Unlike points, norms, term vectors or doc values which only get written to 
> the directory when at least one of the fields uses the data structure, 
> postings always get written to the directory.
> While this isn't hurting much, it can be surprising at times, e.g. if you 
> index with SimpleText you will have a file for postings even though none of 
> the fields indexes postings. This inconsistency is hidden with the default 
> codec due to the fact that it uses PerFieldPostingsFormat, which only 
> delegates to any of the per-field codecs if any of the fields is actually 
> indexed, so you don't actually get a file if none of the fields is indexed.
> We noticed this behavior by creating a codec that throws 
> UnsupportedOperationException for postings since it's not expected to have 
> postings, and it always fails writing or reading data. While it's easy to 
> work around this issue on top of Lucene by using a dummy postings format, it 
> would be better to fix Lucene to handle postings consistently with other data 
> structures?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to