Thanks,

The result of adding &debugQuery=true follows. Does this mean the order is
always defined from score? If that is the case, do I have to adjust the way
how solr calculate score? How can I do that?

I followed Otis's sugestion also and add &sort=word+asc but the first one is
not "apple", but "A as in apple"...

Best,

-----------------------------------
<lst name="debug">
<str name="rawquerystring">apple</str>
<str name="querystring">apple</str>
<str name="parsedquery">word:appl</str>
<str name="parsedquery_toString">word:appl</str>
−
<lst name="explain">
−
<str name="An apple!">

9.692953 = (MATCH) fieldWeight(word:appl in 3178), product of:
  1.0 = tf(termFreq(word:appl)=1)
  9.692953 = idf(docFreq=287, numDocs=1123433)
  1.0 = fieldNorm(field=word, doc=3178)
</str>
−
<str name="A as in apple">

9.692953 = (MATCH) fieldWeight(word:appl in 76151), product of:
  1.0 = tf(termFreq(word:appl)=1)
  9.692953 = idf(docFreq=287, numDocs=1123433)
  1.0 = fieldNorm(field=word, doc=76151)
</str>
−
<str name="appl.">

9.692953 = (MATCH) fieldWeight(word:appl in 156584), product of:
  1.0 = tf(termFreq(word:appl)=1)
  9.692953 = idf(docFreq=287, numDocs=1123433)
  1.0 = fieldNorm(field=word, doc=156584)
</str>
−
<str name="apple">

9.692953 = (MATCH) fieldWeight(word:appl in 156637), product of:
  1.0 = tf(termFreq(word:appl)=1)
  9.692953 = idf(docFreq=287, numDocs=1123433)
  1.0 = fieldNorm(field=word, doc=156637)
</str>
−
<str name="Apple">

9.692953 = (MATCH) fieldWeight(word:appl in 156638), product of:
  1.0 = tf(termFreq(word:appl)=1)
  9.692953 = idf(docFreq=287, numDocs=1123433)
  1.0 = fieldNorm(field=word, doc=156638)
</str>
−
<str name="apples">

9.692953 = (MATCH) fieldWeight(word:appl in 156742), product of:
  1.0 = tf(termFreq(word:appl)=1)
  9.692953 = idf(docFreq=287, numDocs=1123433)
  1.0 = fieldNorm(field=word, doc=156742)
</str>
−
<str name="Appling">

9.692953 = (MATCH) fieldWeight(word:appl in 157509), product of:
  1.0 = tf(termFreq(word:appl)=1)
  9.692953 = idf(docFreq=287, numDocs=1123433)
  1.0 = fieldNorm(field=word, doc=157509)
</str>
−
<str name="apples to apples">

8.567441 = (MATCH) fieldWeight(word:appl in 156746), product of:
  1.4142135 = tf(termFreq(word:appl)=2)
  9.692953 = idf(docFreq=287, numDocs=1123433)
  0.625 = fieldNorm(field=word, doc=156746)
</str>
−
<str name="Adam's apple">

6.058096 = (MATCH) fieldWeight(word:appl in 97069), product of:
  1.0 = tf(termFreq(word:appl)=1)
  9.692953 = idf(docFreq=287, numDocs=1123433)
  0.625 = fieldNorm(field=word, doc=97069)
</str>
−
<str name="allergic to apples">

6.058096 = (MATCH) fieldWeight(word:appl in 123198), product of:
  1.0 = tf(termFreq(word:appl)=1)
  9.692953 = idf(docFreq=287, numDocs=1123433)
  0.625 = fieldNorm(field=word, doc=123198)
</str>
</lst>
---------------------------------------------------------


Erik Hatcher wrote:
> 
> Add &debugQuery=true and look at the enlightening scoring explanations.
> 
>       Erik
> 
> On Jun 19, 2009, at 11:23 AM, akinori wrote:
> 
>>
>> I am straggling with search result order of Solr.
>> I indexed a English-certain language dictionary to Solr.
>>
>> Then below is the result of query="apple" and I am confused with  
>> this. Why
>> doesn't "apple" come first and then Apple ?
>> I'd like to have your suggestion to fix this to more. I am really  
>> stressed
>> about this these days.
>> Any input is much appreciated.
>>
>> Thanks
>>
>> (example word list)
>> An apple!
>> A as in apple
>> appl.
>> apple
>> Apple
>> apples
>> Appling
>> apples to apples
>> Adam's apple
>> allergic apples
>> alley apple
>> apple allergy
>> apple compote
>> apple divider
>> bad apple
>>
>> (schema.xml)
>> <?xml version="1.0" encoding="UTF-8" ?>
>> <!--
>> Licensed to the Apache Software Foundation (ASF) under one or more
>> contributor license agreements.  See the NOTICE file distributed with
>> this work for additional information regarding copyright ownership.
>> The ASF licenses this file to You under the Apache License, Version  
>> 2.0
>> (the "License"); you may not use this file except in compliance with
>> the License.  You may obtain a copy of the License at
>>
>>     http://www.apache.org/licenses/LICENSE-2.0
>>
>> Unless required by applicable law or agreed to in writing, software
>> distributed under the License is distributed on an "AS IS" BASIS,
>> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or  
>> implied.
>> See the License for the specific language governing permissions and
>> limitations under the License.
>> -->
>>
>> <!--
>> This is the Solr schema file. This file should be named "schema.xml"  
>> and
>> should be in the conf directory under the solr home
>> (i.e. ./solr/conf/schema.xml by default)
>> or located where the classloader for the Solr webapp can find it.
>>
>> This example schema is the recommended starting point for users.
>> It should be kept correct and concise, usable out-of-the-box.
>>
>> For more information, on how to customize this file, please see
>> http://wiki.apache.org/solr/SchemaXml
>>
>> NOTE: this schema includes many optional features and should not
>> be used for benchmarking.
>> -->
>>
>> <schema name="example" version="1.2">
>>  <!-- attribute "name" is the name of this schema and is only used for
>> display purposes.
>>       Applications should change this to reflect the nature of the  
>> search
>> collection.
>>       version="1.2" is Solr's version number for the schema syntax and
>> semantics.  It should
>>       not normally be changed by applications.
>>       1.0: multiValued attribute did not exist, all fields are  
>> multiValued
>> by nature
>>       1.1: multiValued attribute introduced, false by default
>>       1.2: omitTermFreqAndPositions attribute introduced, true by  
>> default
>> -->
>>
>>  <types>
>>    <!-- field type definitions. The "name" attribute is
>>       just a label to be used by field definitions.  The "class"
>>       attribute and any other attributes determine the real
>>       behavior of the fieldType.
>>         Class names starting with "solr" refer to java classes in the
>>       org.apache.solr.analysis package.
>>    -->
>>
>>    <!-- The StrField type is not analyzed, but indexed/stored  
>> verbatim.
>>       - StrField and TextField support an optional compressThreshold  
>> which
>>       limits compression (if enabled in the derived fields) to  
>> values which
>>       exceed a certain size (in characters).
>>    -->
>>    <fieldType name="string" class="solr.StrField"  
>> sortMissingLast="true"
>> omitNorms="true"/>
>>
>>    <!-- boolean type: "true" or "false" -->
>>    <fieldType name="boolean" class="solr.BoolField"  
>> sortMissingLast="true"
>> omitNorms="true"/>
>>
>>    <!-- The optional sortMissingLast and sortMissingFirst attributes  
>> are
>>         currently supported on types that are sorted internally as  
>> strings.
>>       - If sortMissingLast="true", then a sort on this field will  
>> cause
>> documents
>>         without the field to come after documents with the field,
>>         regardless of the requested sort order (asc or desc).
>>       - If sortMissingFirst="true", then a sort on this field will  
>> cause
>> documents
>>         without the field to come before documents with the field,
>>         regardless of the requested sort order.
>>       - If sortMissingLast="false" and sortMissingFirst="false" (the
>> default),
>>         then default lucene sorting will be used which places docs  
>> without
>> the
>>         field first in an ascending sort and last in a descending  
>> sort.
>>    -->
>>
>>
>>    <!-- numeric field types that store and index the text
>>         value verbatim (and hence don't support range queries, since  
>> the
>>         lexicographic ordering isn't equal to the numeric ordering)  
>> -->
>>    <fieldType name="integer" class="solr.IntField" omitNorms="true"/>
>>    <fieldType name="long" class="solr.LongField" omitNorms="true"/>
>>    <fieldType name="float" class="solr.FloatField" omitNorms="true"/>
>>    <fieldType name="double" class="solr.DoubleField"  
>> omitNorms="true"/>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Result-orde-is-different-from-I-expect-tp24113572p24113572.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Result-order-is-different-from-I-expect-tp24113572p24124583.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to