I believe the document level boost translates into boosts for all the
fields. If so, the question is what type your fields are. The
primitive fields (int, bool, and - importantly - string) do not have
boosts enabled by default. Try setting omitNorms=false on field
definition and see if the reindexing will help. Search for omitNorms
at http://wiki.apache.org/solr/SchemaXml for more details.

Regards,
   Alex.
Personal blog: http://blog.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all
at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
book)


On Tue, May 21, 2013 at 7:13 PM, Arun Rangarajan
<arunrangara...@gmail.com> wrote:
> 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 &lt; 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.

Reply via email to