How do I build a DocValuesIterator similar to the way FieldCache can be used?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I build a DocValuesIterator similar to the way FieldCache can be used?

MarcoR
Greetings,

I'm trying to use BinaryDocValues but I cannot find a way to create an
instance of this type in the way FieldCache can be used: that is, provide an
IndexReader and get back the field cache.

DocValues.getBinary is expecting a LeafReader and I cannot use it by simply
providing an IndexReader. I used BinaryDocValues in a function score query
before but in this case I just want to access DocValues based on a field
name.

How is DocValues supposed to be used as a FieldCache in this case? I could
access a FieldCache at any point I'd need within my code but it looks like
DocValues is limited to cases where I'm given a leaf reader (or a context
that'll give me a leaf reader).

I read everything I could find but I could not find a single example of how
DocValues is supposed to be used, especially as a replacement for the
FieldCache.

All the best
M



--
Sent from: http://lucene.472066.n3.nabble.com/Lucene-Java-Users-f532864.html

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

Reply | Threaded
Open this post in threaded view
|

Re: How do I build a DocValuesIterator similar to the way FieldCache can be used?

MarcoR
Answering my own question in case someone fails to find the answer easily.

As pointed out in  this really helpful discussion
<http://lucene.472066.n3.nabble.com/Updating-the-DocValues-field-doesn-t-seem-to-update-its-associated-StoredField-value-td4340150.html>
, MultiDocValues can be used. I tried it and it works.



--
Sent from: http://lucene.472066.n3.nabble.com/Lucene-Java-Users-f532864.html

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