lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <>
Subject Re: Transformation on a numeric field
Date Tue, 15 Apr 2014 20:35:41 GMT
You can use an update processor. The stateless script update processor will 
let you write arbitrary JavaScript code, which can do this calculation.

You should be able to figure it  out from the wiki:

My e-book has plenty of script examples for this processor as well.

We could also write a generic script that takes a source and destination 
field name and then does a specified operation on it, like add an offset or 
multiple by a scale factor.

-- Jack Krupansky

-----Original Message----- 
From: Jean-Sebastien Vachon
Sent: Tuesday, April 15, 2014 3:57 PM
To: ''
Subject: Transformation on a numeric field

Hi All,

I am looking for a way to index a numeric field and its value divided by 1 
000 into another numeric field.
I thought about using a CopyField with a PatternReplaceFilterFactory to keep 
only the first few digits (cutting the last three).

Solr complains that I can not have an analysis chain on a numeric field:

Plugin init failure for [schema.xml] fieldType "truncated_salary": 
FieldType: TrieIntField (truncated_salary) does not support specifying an 
analyzer. Schema file is /data/solr/solr-no-cloud/Core1/schema.xml

Is there a way to accomplish this ?


View raw message