I want to manipulate doc and change the token value for field(s) by prepending some value to each token. I am doing bulk update through DIH and also posting Documents through SOLRJ. I have replication factor as 2, so Replication should also work. The value that I want to prepend is there in the document as a separate field. I am interested to know the place where I can intercept the document before the indexing so that I can manipulate it. One of the option I can think of overriding DirectUpdateHandler2. Is this the right place?
I can do it by externally processing the document and passing it to SOLR But I want to do it inside SOLR.
Document fields are :
- city:mumbai
- RestaurantName:Talk About
- Keywords:Cofee, Chines, South Indian, Bar
I want to index keywords as
- mumbai_cofee
- mumbai_Chines
- mumbai_South Indian
- mumbai_Bar
<datasource>
. If you're using that, then you can accomplish this in your embedded SQL queries. If so, you could useCONCAT(RestaurantName,"_",city) AS restaurant, CONCAT(Keyword,"_",city) AS keyword
in your SQL query within your Solr's data import config. – francesfq=city:mumbai&q=keyword:bar
. If this would meet your needs it seems like an easier way to index the data and leaves you more flexible in how you query. – frances