Hi -
I'm having a problem getting boosts to work the way I think they are
supposed to.
What I want is for documents to be returned in doc boost order, when
all the queries are constant scoring range queries. (e.g. date:[2006 TO 2007])
I believe (but am not certain) that this is supposed to be what
happens. If that's not the case, you can probably skip the rest :-)
As an example, I grabbed solr-1.1, and ran it (java -jar start.jar).
Then I modified the hd.xml example doc, to add a boost on the first
document (SP2514N)
<doc boost="100.0">
Then I loaded monitor.xml, and hd.xml
./post.sh monitor.xml
./post.sh hd.xml
I then went to the solr admin interface and queried on
id:[* TO *]
Which I believe gets mapped to a ConstantScoreRangeQuery.
So, given
http://fred:8983/solr/select/?q=id%3A%5B*+TO+*%5D&version=2.2&start=0&rows=10&indent=on&debugQuery=1
I get the result below. Note that all the results list "boost=1.0"
I would expect to see a boost of 100 on the SP2514N, in the
explanation. Should I get that? I would also expect it to be at the
head of the list, but I think I'm seeing the docs in insertion order.
(if I insert xd.xml before monitor.xml, I get them in insertion order
in that case as well.)
Please let me know if my assumptions or my methods aren't correct.
Thanks,
Tom
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">4</int>
<lst name="params">
<str name="rows">10</str>
<str name="start">0</str>
<str name="indent">on</str>
<str name="q">id:[* TO *]</str>
<str name="debugQuery">1</str>
<str name="version">2.2</str>
</lst>
</lst>
<result name="response" numFound="3" start="0">
<doc>
<arr name="cat"><str>electronics</str><str>monitor</str></arr>
<arr name="features"><str>30" TFT active matrix LCD, 2560 x 1600,
.25mm dot pitch, 700:1 contrast</str></arr>
<str name="id">3007WFP</str>
<bool name="inStock">true</bool>
<str name="includes">USB cable</str>
<str name="manu">Dell, Inc.</str>
<str name="name">Dell Widescreen UltraSharp 3007WFP</str>
<int name="popularity">6</int>
<float name="price">2199.0</float>
<str name="sku">3007WFP</str>
<float name="weight">401.6</float>
</doc>
<doc>
<arr name="cat"><str>electronics</str><str>hard drive</str></arr>
<arr name="features"><str>7200RPM, 8MB cache, IDE Ultra
ATA-133</str><str>NoiseGuard, SilentSeek technology, Fluid Dynamic
Bearing (FDB) motor</str></arr>
<str name="id">SP2514N</str>
<bool name="inStock">true</bool>
<str name="manu">Samsung Electronics Co. Ltd.</str>
<str name="name">Samsung SpinPoint P120 SP2514N - hard drive - 250
GB - ATA-133</str>
<int name="popularity">6</int>
<float name="price">92.0</float>
<str name="sku">SP2514N</str>
</doc>
<doc>
<arr name="cat"><str>electronics</str><str>hard drive</str></arr>
<arr name="features"><str>SATA 3.0Gb/s, NCQ</str><str>8.5ms
seek</str><str>16MB cache</str></arr>
<str name="id">6H500F0</str>
<bool name="inStock">true</bool>
<str name="manu">Maxtor Corp.</str>
<str name="name">Maxtor DiamondMax 11 - hard drive - 500 GB - SATA-300</str>
<int name="popularity">6</int>
<float name="price">350.0</float>
<str name="sku">6H500F0</str>
</doc>
</result>
<lst name="debug">
<str name="rawquerystring">id:[* TO *]</str>
<str name="querystring">id:[* TO *]</str>
<str name="parsedquery">id:[* TO *]</str>
<str name="parsedquery_toString">id:[* TO *]</str>
<lst name="explain">
<str name="id=3007WFP,internal_docid=8">
1.0 = (MATCH) ConstantScoreQuery(id:[-}), product of:
1.0 = boost
1.0 = queryNorm
</str>
<str name="id=SP2514N,internal_docid=9">
1.0 = (MATCH) ConstantScoreQuery(id:[-}), product of:
1.0 = boost
1.0 = queryNorm
</str>
<str name="id=6H500F0,internal_docid=10">
1.0 = (MATCH) ConstantScoreQuery(id:[-}), product of:
1.0 = boost
1.0 = queryNorm
</str>
</lst>
</lst>
</response>