lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [lucenenet] jregnier commented on issue #477: Fetching a docvalue from the index
Date Thu, 29 Apr 2021 13:47:24 GMT

jregnier commented on issue #477:

   Hello again, So I think I'm getting closer lol, seems like the way to go is to create a
custom ICollector. Below is what I have so far. Am I on the right track so far?
   `    public class MyCollector : ICollector
           private readonly OpenBitSet _bits;
           private int _docBase;
           private BinaryDocValues _docValues;
           private HashSet<string> _values;
           public MyCollector(OpenBitSet bits)
               _bits = bits ?? throw new ArgumentNullException(nameof(bits));
               _values= new HashSet<string>();
           public bool AcceptsDocsOutOfOrder => true;
           public void Collect(int doc)
               _bits.Set(doc + _docBase);
               if (_docValues== null)
               var byteRef = new BytesRef();
               _docValues.Get(doc, byteRef);
           public void SetNextReader(AtomicReaderContext context)
               _docValues = context.AtomicReader.GetBinaryDocValues("the_value");
               _docBase = context.DocBase;
           public void SetScorer(Scorer scorer)
               // We don't care about the score.

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

View raw message