Hey Martin: There is a test case in the PR we created on our own fork: https://github.com/dashbase/lucene-solr/pull/1, which also contains some example code on how to access in the PR description.
Here is the link to the beginning of the tests: https://github.com/dashbase/lucene-solr/blob/posting-last-docid/lucene/core/src/test/org/apache/lucene/codecs/lucene84/TestLucene84PostingsFormat.java#L142 I am not sure which version this should be applied to, currently, it was based on master as of a few days ago. We intend to patch 8.7 for our own environment. Any advice or feedback is much appreciated. Thank you! -John On Wed, Jan 6, 2021 at 3:28 AM Martin Gainty <mgai...@hotmail.com> wrote: > how to access first and last? > which version will you be merging > > ------------------------------ > *From:* John Wang <john.w...@gmail.com> > *Sent:* Tuesday, January 5, 2021 8:19 PM > *To:* dev@lucene.apache.org <dev@lucene.apache.org> > *Subject:* additional term meta data > > Hi folks: > > We like to propose a feature to add additional per-term metadata to the > term diction. > > Currently, the TermsEnum API returns docFreq as its only meta-data. We > needed a way to quickly get the first and last doc id in the postings > without having to scan through the entire postings list. > > We have created a PR on our own fork and we would like to contribute this > back to the community. Please let us know if this is something that's > useful and/or fits Lucene's roadmap, we would be happy to submit a patch. > > https://github.com/dashbase/lucene-solr/pull/1 > > Thank you > > -John >