Thanks all for your valuable inputs. I looked at suggested solutions and I too feel, a* custom update processor*during indexing will be the best solution to handle the content field by changing the value and storing it in another value.
Do I only need to change the below request handler to intercept all indexing documents to perform my custom analysis during indexing? Or do I need to change any other request handler also? <requestHandler name="/update" class="solr.UpdateRequestHandler"> Thanks, Dileepa On Tue, Nov 12, 2013 at 7:37 PM, Jack Krupansky <j...@basetechnology.com>wrote: > 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 >