Actual Stored Fields are no-go definitely. You can hit any kind of forward-view index. http://www.youtube.com/watch?v=T5RmMNDR5XI Look at StrFieldSource, IntFieldSource. If you wonder how to access stored fields anyway, call org.apache.lucene.index.IndexReader.document(int). Beware of difference between segment-local docnums, and global ones, which are used by Solr sometimes.
On Wed, Sep 24, 2014 at 3:08 AM, Scott Smith <ssm...@mainstreamdata.com> wrote: > I'm creating a custom function (extends ValueSource). I'm generating a > value that will both be returned as a value in the hit for each doc and > also be used to sort. As I read the documentation, this is not difficult. > > To determine the value for a document, I need to access the "stored" > fields for that document (i.e., the value that the function will generate > partially depends on stored information in the document). How do I access > them from the getValues() method? Is this via the FieldCache.DEFAULT? I'm > using solr 4.8 if that makes a difference (which I think it does since > older examples seem to have been deprecated). For example, if I have a > field called "Fred", how do I access that field from the document? > > Is accessing the stored data going to have a big impact on the time to > return results? > > Thanks > > Scott > -- Sincerely yours Mikhail Khludnev Principal Engineer, Grid Dynamics <http://www.griddynamics.com> <mkhlud...@griddynamics.com>