You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by dboychuck <db...@build.com> on 2012/04/06 22:38:26 UTC
Solr dismax not returning expected results
I am upgrading to solr 3.5 from my current 1.4 and I am having trouble with
dismax returning different results and would like some help on figuring this
problem out.
Here is my schema.xml that is the same for both 1.4 and 3.5 solr instances
<field name="id" type="string" indexed="true" stored="true"/>
<field name="sku" type="textTight" indexed="true" stored="true"
multiValued="true"/>
<field name="upc" type="textTight" indexed="true" stored="true"
multiValued="true"/>
<field name="productID" type="textTight" indexed="true" stored="true"/>
<field name="manufacturer" type="text" indexed="true" stored="true" />
<field name="productTitle" type="text" indexed="true" stored="true"/>
<field name="categoryId" type="sint" indexed="true" stored="true"
multiValued="true"/>
<field name="categoryName" type="text" indexed="true" stored="false"
multiValued="true"/>
<field name="theme" type="text" indexed="true" stored="true"/>
<field name="description" type="text" indexed="true" stored="false"/>
<field name="weight" type="sfloat" indexed="true" stored="true"/>
<field name="price" type="sfloat" indexed="true" stored="true"
multiValued="true"/>
<field name="popularity" type="sint" indexed="true" stored="true"
default="0"/>
<field name="inStock" type="boolean" indexed="true" stored="true"
multiValued="true"/>
<field name="onSale" type="boolean" indexed="true" stored="true"/>
<field name="hasDigiCast" type="boolean" indexed="true" stored="true"/>
<field name="hasDigiVista" type="boolean" indexed="true" stored="true"/>
<field name="isNew" type="boolean" indexed="true" stored="true"/>
<field name="isTopSeller" type="boolean" indexed="true" stored="true"/>
<field name="finish" type="text" indexed="true" stored="true"
multiValued="true"/>
<field name="masterFinish" type="text" indexed="true" stored="true"
multiValued="true"/>
<field name="series" type="text" indexed="true" stored="true"/>
<field name="searchKeyword" type="text_ws" indexed="true" stored="false"
multiValued="true"/>
<field name="discontinued" type="boolean" indexed="true" stored="true" />
Here are my text and textTight and text_ws definitions
<fieldtype name="text_ws" class="solr.TextField"
positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
</analyzer>
</fieldtype>
<fieldtype name="text" class="solr.TextField"
positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="1"
catenateNumbers="1" catenateAll="0"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="0"
catenateNumbers="0" catenateAll="0"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
</fieldtype>
<fieldtype name="textTight" class="solr.TextField"
positionIncrementGap="100" >
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="false"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="1"
catenateNumbers="1" catenateAll="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
</fieldtype>
Here is my dismax handler for version 1.4
<requestHandler name="dismax" class="solr.DisMaxRequestHandler" >
<lst name="defaults">
<str name="echoParams">explicit</str>
<float name="tie">0.01</float>
<str name="qf">
sku^9.0 upc^9.1 searchKeyword^1.9 series^2.8 productTitle^1.2
productID^9.0 manufacturer^4.0 masterFinish^1.5 theme^1.1 categoryName^2.0
finish^1.4
</str>
<str name="pf">
searchKeyword^2.1 text^0.2 productTitle^1.5 manufacturer^4.0
finish^1.9
</str>
<str name="bq">
isTopSeller:true^1.30
</str>
<str name="bf">
linear(popularity,1,2)^3.0
</str>
<str name="fl">
productID,manufacturer
</str>
<str name="mm">
3<-1 5<-2 6<90%
</str>
<int name="ps">1000000</int>
<int name="qs">3</int>
<str name="fq">
discontinued:false
</str>
</lst>
<lst name="appends">
<str name="fq">
discontinued:false
</str>
</lst>
</requestHandler>
<requestHandler name="dismax-disc" class="solr.DisMaxRequestHandler" >
<lst name="defaults">
<float name="tie">0.01</float>
<str name="qf">
sku^9.0 upc^9.1 searchKeyword^1.9 series^2.8 productTitle^1.2
productID^9.0 manufacturer^4.0 masterFinish^1.5 theme^1.1 categoryName^2.0
finish^1.4
</str>
<str name="pf">
searchKeyword^2.1 text^0.2 productTitle^1.5 manufacturer^4.0
finish^1.9
</str>
<str name="bq">
isTopSeller:true^1.30
</str>
<str name="bf">
linear(popularity,1,2)^3.0
</str>
<str name="fl">
productID,manufacturer
</str>
<str name="mm">
3<-1 5<-2 6<90%
</str>
<str name="fq">
discontinued:true
</str>
<int name="ps">1000000</int>
<int name="qs">3</int>
</lst>
<lst name="appends">
<str name="fq">
discontinued:true
</str>
</lst>
</requestHandler>
Here is my dismax handler for 3.5
<requestHandler name="dismax" class="solr.SearchHandler">
<lst name="defaults">
<str name="defType">dismax</str>
<str name="echoParams">explicit</str>
<float name="tie">0.01</float>
<str name="qf">
sku^9.0 upc^9.1 searchKeyword^1.9 series^2.8 productTitle^1.2
productID^9.0 manufacturer^4.0 masterFinish^1.5 theme^1.1 categoryName^2.0
finish^1.4
</str>
<str name="pf">
searchKeyword^2.1 text^0.2 productTitle^1.5 manufacturer^4.0
finish^1.9
</str>
<str name="bq">
isTopSeller:true^1.30
</str>
<str name="bf">
linear(popularity,1,2)^3.0
</str>
<str name="fl">
productID,manufacturer
</str>
<str name="mm">
3<-1 5<-2 6<90%
</str>
<int name="ps">1000000</int>
<int name="qs">3</int>
<str name="fq">
discontinued:false
</str>
</lst>
<lst name="appends">
<str name="fq">
discontinued:false
</str>
</lst>
</requestHandler>
To me everything seems identical but I am getting different search results.
I am expecting one search result for my search term 'K-690'
Here is the 1.4 debug output which is returning one result as I want to
happen
<str name="rawquerystring">k-690</str>
<str name="querystring">k-690</str>
<str name="parsedquery">
+DisjunctionMaxQuery((finish:"k 690"~3^1.4 | categoryName:"k 690"~3^2.0 |
series:"k 690"~3^2.8 | masterFinish:"k 690"~3^1.5 | manufacturer:"k
690"~3^4.0 | theme:"k 690"~3^1.1 | searchKeyword:k-690^1.9 | productTitle:"k
690"~3^1.2 | sku:"k (690 k690)"~3^9.0 | upc:"k (690 k690)"~3^9.1 |
productID:"k (690 k690)"~3^9.0)~0.01) DisjunctionMaxQuery((finish:"k
690"~1000000^1.9 | text:"k 690"~1000000^0.2 | manufacturer:"k
690"~1000000^4.0 | productTitle:"k 690"~1000000^1.5 |
searchKeyword:k-690^2.1)~0.01) isTopSeller:true^1.3
FunctionQuery((1.0*float(sint(popularity))+2.0)^3.0)
</str>
<str name="parsedquery_toString">
+(finish:"k 690"~3^1.4 | categoryName:"k 690"~3^2.0 | series:"k 690"~3^2.8 |
masterFinish:"k 690"~3^1.5 | manufacturer:"k 690"~3^4.0 | theme:"k
690"~3^1.1 | searchKeyword:k-690^1.9 | productTitle:"k 690"~3^1.2 | sku:"k
(690 k690)"~3^9.0 | upc:"k (690 k690)"~3^9.1 | productID:"k (690
k690)"~3^9.0)~0.01 (finish:"k 690"~1000000^1.9 | text:"k 690"~1000000^0.2 |
manufacturer:"k 690"~1000000^4.0 | productTitle:"k 690"~1000000^1.5 |
searchKeyword:k-690^2.1)~0.01 isTopSeller:T^1.3
(1.0*float(sint(popularity))+2.0)^3.0
</str>
Here is my 3.5 debug output that is returning thousands of results
<lst name="debug">
<str name="rawquerystring">k-690</str>
<str name="querystring">k-690</str>
<str name="parsedquery">
+DisjunctionMaxQuery((((finish:k finish:690)^1.4) | ((categoryName:k
categoryName:690)^2.0) | ((series:k series:690)^2.8) | ((masterFinish:k
masterFinish:690)^1.5) | ((manufacturer:k manufacturer:690)^4.0) | ((theme:k
theme:690)^1.1) | searchKeyword:k-690^1.9 | ((productTitle:k
productTitle:690)^1.2) | ((sku:k sku:690 sku:k690)^9.0) | ((upc:k upc:690
upc:k690)^9.1) | ((productID:k productID:690 productID:k690)^9.0))~0.01)
DisjunctionMaxQuery((finish:"k 690"~1000000^1.9 | text:"k 690"~1000000^0.2 |
manufacturer:"k 690"~1000000^4.0 | productTitle:"k 690"~1000000^1.5 |
searchKeyword:k-690^2.1)~0.01) isTopSeller:true^1.3
FunctionQuery((1.0*float(sint(popularity))+2.0)^3.0)
</str>
<str name="parsedquery_toString">
+(((finish:k finish:690)^1.4) | ((categoryName:k categoryName:690)^2.0) |
((series:k series:690)^2.8) | ((masterFinish:k masterFinish:690)^1.5) |
((manufacturer:k manufacturer:690)^4.0) | ((theme:k theme:690)^1.1) |
searchKeyword:k-690^1.9 | ((productTitle:k productTitle:690)^1.2) | ((sku:k
sku:690 sku:k690)^9.0) | ((upc:k upc:690 upc:k690)^9.1) | ((productID:k
productID:690 productID:k690)^9.0))~0.01 (finish:"k 690"~1000000^1.9 |
text:"k 690"~1000000^0.2 | manufacturer:"k 690"~1000000^4.0 |
productTitle:"k 690"~1000000^1.5 | searchKeyword:k-690^2.1)~0.01
isTopSeller:T^1.3 (1.0*float(sint(popularity))+2.0)^3.0
</str>
As you can see it seems to be breaking apart my search term which seems to
be the reason that I am getting more than one result.
If I add quotes to the search term ie. "K-690" then I only get one result.
What could be the cause of this problem if my text and textTight definitions
are exactly the same?
--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-dismax-not-returning-expected-results-tp3891346p3891346.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solr dismax not returning expected results
Posted by dboychuck <db...@build.com>.
Adding autoGeneratePhraseQueries="true" to my field definitions has solved
the problem
--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-dismax-not-returning-expected-results-tp3891346p3891594.html
Sent from the Solr - User mailing list archive at Nabble.com.