Solr and custom update handler

2019-05-18 19:40发布

问题:

I have a question about Solr and the possibility to implement a customized update handler

Basically, the scenario is this:

  • FIELD-A : my main field
  • FIELD-B and FIELD-C : 2 copyfield with source in A

After FIELD-A has its value stored, i need this valued to be copied in FIELD-B and C, then processed (let's say extract a substring) and stored in FIELD-B and C before indexing time. I'm not using DIH.

edit: i'm pushing my data via nutch (forgot to mention that)

As far as i've understood, copyfields triggers after indexing (but i'm not so sure about this).

I've already read throu the wiki page and still i don't understand a lot of things:

1) customupdateprocessor is an alternative to conditionalcopyfield or do they have to exist both in my solr?

2) after creating my conditionalcopyfield jar file, how do i declare it in my schema?

3) how do i have to modify my solrconfig.xml to use my updater?

4) if i'm choosing the wrong way, any suggestion is appreciated, better if some examples or well documented links are provided

I read a lot (googling and lucene ml on nabble) but there's not so much documentation about this. I just need to create a custom updater for my two copyfields,

Thanks all in advance!

回答1:

Its not really complicated.. Following is an excellent link I came across to write a custom solr update handler.

  http://knackforge.com/blog/selvam/integrating-solr-and-mahout-classifier

I tested it in my solr and it just works fine!



回答2:

If you are using SOLR 4 or planning to use it, http://wiki.apache.org/solr/ScriptUpdateProcessor could be an easier solution. Have fun!