lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <>
Subject Re: Enrich search results with external data
Date Sat, 11 Apr 2015 05:38:17 GMT

Who don't you include/add/index those additional fields, at least the one used in sorting?

Also, you may find relevant.


On Saturday, April 11, 2015 1:04 AM, "" <>
This ticket seems to address the problem I have

and as the result of that ticket, DocTransformer is added since Solr 4.0. I wrote a simple
DocTransformer and found that the transformer is executed AFTER pagination. In our application,
we need the external fields added before sorting/pagination. I've looked around for the option
to change the execution order but haven't had any luck. Does anyone know the solution?

The ticket also states "it is not possible for components to add fields to outgoing documents
which are not in the stored fields of the document". Does anyone know if this is still true?



-----Original Message-----

From: Pham, Ha

Sent: Thursday, April 09, 2015 11:41 PM


Subject: Enrich search results with external data

Hi everyone,

We have a requirement to append external data (e.g. price/inventory of product, retrieved
from an ERP via web services) to query result and support sorting and pagination based on
those external fields. For example if Solr returns 100 records and the page size user selects
is 20, the sorting on the external  fields is still on 100 records. This limits us from enriching
search results outside of Solr. I guess this is a common problem so hopefully someone could
share their experience.

I am considering using a PostFilter and enrich documents in collect() method as below


public void collect(int docId) throws IOException { DoubleField price = new DoubleField ("PRICE",
1.23, Field.Store.YES); Document currentDoc = context.reader().document(docId); currentDoc.add(price);

but the result documents don't have PRICE fields. Did I miss anything here?

I also did some research and it seems the approach mentioned here
is close to what we need to achieve but since the document is 4 years old, I don't know if
there's a better approach for our problem (we are using solr 5.0)?



View raw message