简体   繁体   中英

In solr using schema how to Copy min price in new field

I have 3 fields in solr document Price1, Price2, Price3. From this 3 fields i want to get minimum Price and copy it into new field.

Price1: 10

Peice2: 17

Price3: 17

Newly created field will contain min price ie 10.

CustomePrice: 10

How can i achieve this using only Schema or using CloneFieldUpdateProcessorFactory

solr.MinFieldValueUpdateProcessorFactory : An update processor that keeps only the the minimum value from any selected fields where multiple values are found. Correct behavior requires the all of the values in the SolrInputFields being mutated are mutually comparable; If this is not the case, then a SolrException will br thrown. By default, this processor matches no fields.

In the example configuration below, if a document contains multiple integer values (ie: 64, 128, 1024) in the field smallestFileSize then only the smallest value (ie: 64) will be kept in that field.

<processor class="solr.MinFieldValueUpdateProcessorFactory">
    <str name="fieldName">smallestFileSize</str>
  </processor>

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