lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom <>
Subject boosts?
Date Wed, 27 Dec 2006 22:35:18 GMT
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

./ monitor.xml
./ 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


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.



<?xml version="1.0" encoding="UTF-8"?>

<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>
<result name="response" numFound="3" start="0">

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

   <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>
   <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>
<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 name="id=SP2514N,internal_docid=9">
1.0 = (MATCH) ConstantScoreQuery(id:[-}), product of:
   1.0 = boost
   1.0 = queryNorm
   <str name="id=6H500F0,internal_docid=10">

1.0 = (MATCH) ConstantScoreQuery(id:[-}), product of:
   1.0 = boost
   1.0 = queryNorm

View raw message