mikemccand / stargazers-migration-test

Testing Lucene's Jira -> GitHub issues migration
0 stars 0 forks source link

Autogenerated ID for LeafReaderContexts Within An IndexSearcher [LUCENE-8798] #796

Open mikemccand opened 5 years ago

mikemccand commented 5 years ago

It would be good to be able to uniquely identify LeafReaderContext objects associated within a single IndexSearcher. This would allow storing of metadata around segments, such as demonstrated in https://issues.apache.org/jira/browse/LUCENE-879

The ID will be unique across the IndexSearcher instance and will make no guarantees of any semantic value outside the instance.


Legacy Jira details

LUCENE-8798 by Atri Sharma (@atris) on May 13 2019

mikemccand commented 5 years ago

@atris I glanced at the issue you referenced, but I don't see how it relates to this. Could you sketch out a use case where this would be better than using the ordinals that we use today to identify segments? Would these be persisted?

[Legacy Jira: Michael Sokolov (@msokolov) on May 13 2019]

mikemccand commented 5 years ago

@sokolov Yes, as I commented in the other JIRA, this idea does not directly relate to the CollectorScorer patch, but came as an outcome of reading through it.

 

This is more of a readability and clarity perspective proposal – considering that LeafReaderContext allows initialization without assigning a specific ordinal, there should be an unique identifier which will be valid for any constructed LeafReaderContext – irrespective of which constructor initialized it.

 

My primary use case is to allow a secure way of storing in memory runtime metadata about segments during a search execution, hence the invariant that the ID has no relevance outside the scope of the owning IndexSearcher. Making persistent IDs that get written to segment blocks is an interesting idea, but is not what I planned to originally propose.

[Legacy Jira: Atri Sharma (@atris) on May 13 2019]

mikemccand commented 5 years ago

I think what confused me was the link to the other JIRA seems to have a typo - it links to an ancient unrelated issue, but I guess you meant to link to one of your recent ones?

[Legacy Jira: Michael Sokolov (@msokolov) on May 13 2019]

mikemccand commented 5 years ago

@sokolov Yes, sorry about that.

[Legacy Jira: Atri Sharma (@atris) on May 13 2019]