lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paule_lecuyer <>
Subject Port of Custom value source from v4.10.3 to v6.1.0
Date Thu, 07 Jul 2016 17:33:56 GMT
Hi all,
I wrote some time ago a ValueSourceParser + ValueSource to allow using
results produced by an external system as a facet query :
- in solrconfig.xml : added my parser :
    <valueSourceParser name="irboost" class="myValueSourceParser />

-  in search queries, use irboost function as a facet query :

- in ValueSourceParser, the 'somename' info allows to retrieve a map of
(docId, score) produced by the external system, which is passed in
ValueSource constructor
- in valueSource.getValues, I used the following code :

final BinaryDocValues lookup =
FieldCache.DEFAULT.getTerms(readerContext.reader(),  docIdField, false);
return new FunctionValues() {
  public float floatVal( int doc) {
        BytesRef ref = new BytesRef();
        lookup.get(doc, ref)
        return getMyScore(ref.utf8ToString());

Apart from changing AtomicReaderContext to LeafReaderContext, It seems I
cannot use anymore FieldCache as I did. What can I use to retrieve the
content of the docId Field linked to the document <doc> passed to floatval
func ?

Thanks for your help.

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

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

View raw message