Solr: Set a different weight (boost) at each value of a field (with multivalued=true)

425 views Asked by At
  • I'm using Solr4.4.
  • I'm using DIH with RDBMS

I need to set a different weight (boost) at each value of a field (with multivalued=true). In particular, I have a field (text - with multivalued=true) and a float value different for each text, and I would to set that float value as boost at each text of the field.

id - 1
myText: "iphone ipad", "iphone", "ipad"
myFloatValue: 2.3, 4.1, 1.6

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 also 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.

0

There are 0 answers