Development question

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Development question

Billnbell
I am working on https://issues.apache.org/jira/browse/SOLR-2155

Trying to get a list of multiValued fields from the cacheŠ

ValueSource vs = sf.getType().getValueSource(sf, fp);
DocValues llVals = vs.getValues(context, reader);
org.apache.lucene.spatial.geohash.GeoHashUtils.decode(llVals.strVal(doc));

     public String strVal(int doc) {
        int ord=termsIndex.getOrd(doc);
        if (ord == 0) {
          return null;
        } else {
          return termsIndex.lookup(ord, new BytesRef()).utf8ToString();
        }
      }

I figure the problem is that lookup only returns one. I need more than 1Š I
thought ./lucene/src/java/org/apache/lucene/document/Document.java would
help me, but it didn't much. Would I want to call getFieldables(name) ? Or
would that slow down the caching? Thoughts?

1. What is termIndex ? Why does ord() matter?
2. Is there a helper for getting a multiValue field from the Field cache?

The strVal(doc) only returns one of the multiValues. Thought one of you
gurus might know the answer.

Thanks.

Bill