简体   繁体   中英

SOLR - update a certain field value depending on the field value of another field

I have a field whose default value is false:

<field indexed="true" multiValued="false"
  name="has_status" default="false" />

and I have another field:

<field indexed="true" multiValued="false"
  name="status_value"
 type="string" default="false" />

is there a way to calculate the value for has_status based on if status_value is not empty during indexing? so, when a document is being indexed, if an item has status_list that we put "true" for has status.

If you using DataImportHandler, there are transformers for that. Otherwise, you want to use an UpdateRequestProcessor and the nearly-identical example is on the wiki, or you can put something together with one of the FieldMutating Update Processors .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM