Saturday, 31 August 2013

Solr: Set a different weight (boost) at each value of a multifield

Solr: Set a different weight (boost) at each value of a multifield

I'm using Solr4.4.
I'm using DIH with RDBMS
I need to set a different weight (boost) at each value of a multifield. In
particular, I have a multifield (text) and a float value different for
each text, and I would to set that float value as boost at each text of
the multifield.
In my db-dataimport.xml file
<entity name="item"
query="SELECT myText,
myFloatValue
FROM myTable
WHERE myCondition" >
<field name="myText" column="myText" boost="{$item.myFloatValue}" />
It return an error:
org.apache.solr.handler.dataimport.DataImportHandlerException: Data Config
problem: For input string: "{$places.distance_place}"
at
I tried to set in my query a Cast:
SELECT myText,
CAST(myFloatValue AS DECIMAL(10,6)) as myFloatValue
FROM myTable
WHERE myCondition
I hope that is clear my situation. Thanks in advance.

No comments:

Post a Comment