Solr version: 4.2.1 As explained here: https://wiki.apache.org/solr/DataImportHandler#Special_Commands, I am trying to use index-time document-level boost in data import handler. I have a database table 'boosts' in which the document boosts are stored against the solr unique key.
In data-config.xml, I am using: <entity name="xxx" pk="id" query="SELECT d.id, d.name, b.boost AS '$docBoost' FROM documents d LEFT JOIN boosts b ON d.id = b.id WHERE d.id < 117"/> There are a total of 116 results for that query. (I am assuming LEFT JOIN is the correct thing to do here, so missing entries will get NULL for $docBoost, so they should get the default boost of 1.) For testing, I have the boosts table with only 1 row for id 1 with a boost of 11.1111 mysql> SELECT * FROM boosts\G ********************** id: 1 boost: 11.1111 ********************** When I issue this query http://localhost:8983/solr/CORE/select?q=id:1&fl=id,name,score&wt=xml&debuqQuery=on I am seeing the output as follows: 5.060443 = (MATCH) weight(id:`#8;#0;#0;#2;#20; in 0) [DefaultSimilarity], result of: 5.060443 = fieldWeight in 0, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 5.060443 = idf(docFreq=1, maxDocs=116) 1.0 = fieldNorm(doc=0) I don't see the index-time boost of 11.1111 for this document anywhere in the score, so what am I doing wrong? I tried adding a tfloat field named '$docBoost' in schema.xml, but that didn't help either. Getting same score. Thanks.