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

Robert Muir commented on LUCENE-5148:
-------------------------------------

{quote}
This is not necessarily a bug, this behavior can be documented, but I think it 
would be nice if the API could prevent from such mistakes by storing the state 
in a separate object or cloning the SortedSetDocValues object in 
SegmentCoreReaders.getSortedSetDocValues?
{quote}

An auto-clone could also cause traps, e.g. if someone is calling this method 
multiple times and its refilling buffers and so on. 

But adding clone to the api (so someone could do this explicitly for these 
expert cases) might be a good solution too.
                
> SortedSetDocValues caching / state
> ----------------------------------
>
>                 Key: LUCENE-5148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5148
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Priority: Minor
>
> I just spent some time digging into a bug which was due to the fact that 
> SORTED_SET doc values are stateful (setDocument/nextOrd) and are cached per 
> thread. So if you try to get two instances from the same field in the same 
> thread, you will actually get the same instance and won't be able to iterate 
> over ords of two documents in parallel.
> This is not necessarily a bug, this behavior can be documented, but I think 
> it would be nice if the API could prevent from such mistakes by storing the 
> state in a separate object or cloning the SortedSetDocValues object in 
> SegmentCoreReaders.getSortedSetDocValues?
> What do you think?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to