lucene-solr-user mailing list archives

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

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

Also, you may find https://stanbol.apache.org/docs/trunk/components/enhancer/ relevant.

Ahmet



On Saturday, April 11, 2015 1:04 AM, "ha.pham@arvatosystems.com" <ha.pham@arvatosystems.com>
wrote:
This ticket seems to address the problem I have

https://issues.apache.org/jira/browse/SOLR-1566



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?



Thanks,



-Ha





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

From: Pham, Ha

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

To: solr-user@lucene.apache.org


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



@Override

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 http://sujitpal.blogspot.com/2011/05/custom-sorting-in-solr-using-external.html
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)?



Thanks,



-Ha

Mime
View raw message