Any kind of cross-field processing is best done in an update processor. There are a lot of built-in update processors as well as a JavaScript script update processor.

-- Jack Krupansky

-----Original Message----- From: Dileepa Jayakody
Sent: Tuesday, November 12, 2013 1:31 AM
To: solr-user@lucene.apache.org
Subject: Indexing a token to a different field in a custom filter

Hi All,

In my custom filter, I need to index the processed token into a different
field. The processed token is a Stanbol enhancement response.

The solution I have so far found is to use a Solr client (solj) to add a
new Document with my processed field into Solr. Below is the sample code
segment;

SolrServer server = new HttpSolrServer("http://localhost:8983/solr/";);
       SolrInputDocument doc1 = new SolrInputDocument();
       doc1.addField( "id", "id1", 1.0f );
       doc1.addField("stanbolResponse", response);
       try {
server.add(doc1);
server.commit();
} catch (SolrServerException e) {
e.printStackTrace();
}


This mechanism requires a new HTTP call to the local Solr server for every
token I process for the stanbolRequest field, and I feel it's not very
efficient.

Is there any other alternative way to invoke a update request to add a new
field to the indexing document within the filter (without making an
explicit HTTP call using Solrj)?

Thanks,
Dileepa

Reply via email to