lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan McKinley <>
Subject Re: custom ValueSource for decoding geohash into lat & lon
Date Sat, 12 Mar 2011 06:21:30 GMT
Rather then use the FieldCache, you may consider a
WeakHashMap<IndexReader,YourObject>  solr uses this and the internals
of FieldCache are implemented like this.  Long term, I want to see the
FieldCache moved to a map directly on the IndexReader (LUCENE-2665 but
that has a ways to go)

On Fri, Mar 11, 2011 at 5:25 PM, Smiley, David W. <> wrote:
> On Mar 10, 2011, at 6:21 PM, William Bell wrote:
>> 1. ValueSources does not support MultiValue fields.
> I think the problem isn't ValueSources, it's the FieldCache.  The FieldCache is fundamentally
very limited to one indexed primitive value per document. I took a look at UninvertedField
but that appears to be tied to faceting and it's not sufficiently flexible any way. I think
I need to do, as UninvertedField does, create a cache registered in solrconfig.xml.  The
other tricky bit is somehow accessing it.  I think I figured it out. In my field type's getValueSource(SchemaField
field, QParser parser), the parser is a FunctionQParser implementation, which has access to
SolrQueryRequest, which has access to SolrIndexSearcher, which allows me to lookup the cache
by the name I choose.  That's quite a chain of indirection that took time to track down;
I nearly gave up :-).
> ~ David
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message