Hi,

I am trying to do the wildcard search using the q query parameter with
dismax request. Wildcard search works fine with q.alt parameter but field
boosting doesnt work with q.alt parameter.

I customized the QueryParser class and now the query which is getting formed
for wildcard is exactly the same as without wildcard.

Below is the debug query result for both queries.

Without Wildcard Query

  <?xml version="1.0" encoding="UTF-8" ?> 
- <response>
- <lst name="responseHeader">
  <int name="status">0</int> 
  <int name="QTime">31</int> 
- <lst name="params">
  <str name="rows">10</str> 
  <str name="start">0</str> 
  <str name="indent">on</str> 
  <str name="q">test</str> 
  <str name="qt">dismaxrequest</str> 
  <str name="debugQuery">true</str> 
  <str name="version">2.2</str> 
  </lst>
  </lst>
- <result name="response" numFound="2" start="0" maxScore="5.906053E-4">
- <doc>
  <float name="score">5.906053E-4</float> 
  <str name="IndexId_s">987654321</str> 
  <str name="IndexId_str_s">987654321</str> 
  <str name="productURL_s">testData</str> 
  <str name="productURL_str_s">testData</str> 
  </doc>
- <doc>
  <float name="score">5.906053E-7</float> 
  <str name="IndexId_s">123456789</str> 
  <str name="IndexId_str_s">123456789</str> 
  <str name="prdMainTitle_s">testData</str> 
  <str name="prdMainTitle_str_s">testData</str> 
  </doc>
  </result>
- <lst name="debug">
  <str name="rawquerystring">test</str> 
  <str name="querystring">test</str> 
  <str
name="parsedquery">+DisjunctionMaxQuery((programJacketImage_program_s:test |
courseCodeSeq_course_s:test | authorLastName_product_s:test |
Index_Type_s:test | prdMainTitle_s:test^10.0 | discCode_course_s:test |
sourceGroupName_course_s:test | indexType_course_s:test |
prdMainTitle_product_s:test | isbn10_product_s:test |
displayName_course_s:test | groupNm_program_s:test |
discipline_product_s:test | courseJacketImage_course_s:test |
imprint_product_s:test | introText_program_s:test |
productType_product_s:test | isbn13_product_s:test |
copyrightYear_product_s:test | prdPubDate_product_s:test |
programType_program_s:test | editor_product_s:test |
courseType_course_s:test | productURL_s:test^10000.0 |
courseId_course_s:test | categoryIds_product_s:test |
indexType_program_s:test | strapline_product_s:test |
subCompany_course_s:test | aluminator_product_s:test | readBy_product_s:test
| subject_product_s:test | edition_product_s:test |
programId_program_s:test)~0.01) () all:english^90.0 all:hindi^123.0
all:glorious^2000.0 all:highlight^1.0E7 all:math^100.0 all:ab^12.0
all:erer^4545.0 MultiPhraseQuery(all:"(prd prd main prd main titl prd main
titl s) (main main titl main titl s) (titl titl s) s"^10.0)
MultiPhraseQuery(all:"(product product url product url s) (url url s)
s"^10000.0)</str> 
  <str name="parsedquery_toString">+(programJacketImage_program_s:test |
courseCodeSeq_course_s:test | authorLastName_product_s:test |
Index_Type_s:test | prdMainTitle_s:test^10.0 | discCode_course_s:test |
sourceGroupName_course_s:test | indexType_course_s:test |
prdMainTitle_product_s:test | isbn10_product_s:test |
displayName_course_s:test | groupNm_program_s:test |
discipline_product_s:test | courseJacketImage_course_s:test |
imprint_product_s:test | introText_program_s:test |
productType_product_s:test | isbn13_product_s:test |
copyrightYear_product_s:test | prdPubDate_product_s:test |
programType_program_s:test | editor_product_s:test |
courseType_course_s:test | productURL_s:test^10000.0 |
courseId_course_s:test | categoryIds_product_s:test |
indexType_program_s:test | strapline_product_s:test |
subCompany_course_s:test | aluminator_product_s:test | readBy_product_s:test
| subject_product_s:test | edition_product_s:test |
programId_program_s:test)~0.01 () all:english^90.0 all:hindi^123.0
all:glorious^2000.0 all:highlight^1.0E7 all:math^100.0 all:ab^12.0
all:erer^4545.0 all:"(prd prd main prd main titl prd main titl s) (main main
titl main titl s) (titl titl s) s"^10.0 all:"(product product url product
url s) (url url s) s"^10000.0</str> 
- <lst name="explain">
  <str name="987654321">5.906053E-4 = (MATCH) sum of: 5.906053E-4 = (MATCH)
max plus 0.01 times others of: 5.906053E-4 = (MATCH)
weight(productURL_s:test^10000.0 in 1), product of: 5.906053E-4 =
queryWeight(productURL_s:test^10000.0), product of: 10000.0 = boost 1.0 =
idf(docFreq=1, numDocs=2) 5.906053E-8 = queryNorm 1.0 = (MATCH)
fieldWeight(productURL_s:test in 1), product of: 1.0 =
tf(termFreq(productURL_s:test)=1) 1.0 = idf(docFreq=1, numDocs=2) 1.0 =
fieldNorm(field=productURL_s, doc=1)</str> 
  <str name="123456789">5.906053E-7 = (MATCH) sum of: 5.906053E-7 = (MATCH)
max plus 0.01 times others of: 5.906053E-7 = (MATCH)
weight(prdMainTitle_s:test^10.0 in 0), product of: 5.906053E-7 =
queryWeight(prdMainTitle_s:test^10.0), product of: 10.0 = boost 1.0 =
idf(docFreq=1, numDocs=2) 5.906053E-8 = queryNorm 1.0 = (MATCH)
fieldWeight(prdMainTitle_s:test in 0), product of: 1.0 =
tf(termFreq(prdMainTitle_s:test)=1) 1.0 = idf(docFreq=1, numDocs=2) 1.0 =
fieldNorm(field=prdMainTitle_s, doc=0)</str> 
  </lst>
  <str name="QParser">DismaxQParser</str> 
  <null name="altquerystring" /> 
- <arr name="boost_queries">
  <str>english^90 hindi^123 Glorious^2000 highlighting^10000000 maths^100
ab^12 erer^4545 prdMainTitle_s^10.0 productURL_s^10000.0</str> 
  </arr>
- <arr name="parsed_boost_queries">
  <str>all:english^90.0 all:hindi^123.0 all:glorious^2000.0
all:highlight^1.0E7 all:math^100.0 all:ab^12.0 all:erer^4545.0
MultiPhraseQuery(all:"(prd prd main prd main titl prd main titl s) (main
main titl main titl s) (titl titl s) s"^10.0) MultiPhraseQuery(all:"(product
product url product url s) (url url s) s"^10000.0)</str> 
  </arr>
- <arr name="boostfuncs">
  <str /> 
  </arr>
- <lst name="timing">
  <double name="time">31.0</double> 
- <lst name="prepare">
  <double name="time">15.0</double> 
- <lst name="org.apache.solr.handler.component.QueryComponent">
  <double name="time">15.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.FacetComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.HighlightComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.SpellCheckComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.DebugComponent">
  <double name="time">0.0</double> 
  </lst>
  </lst>
- <lst name="process">
  <double name="time">16.0</double> 
- <lst name="org.apache.solr.handler.component.QueryComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.FacetComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.HighlightComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.SpellCheckComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.DebugComponent">
  <double name="time">16.0</double> 
  </lst>
  </lst>
  </lst>
  </lst>
  </response>



With WildCard query

  <?xml version="1.0" encoding="UTF-8" ?> 
- <response>
- <lst name="responseHeader">
  <int name="status">0</int> 
  <int name="QTime">31</int> 
- <lst name="params">
  <str name="rows">10</str> 
  <str name="start">0</str> 
  <str name="indent">on</str> 
  <str name="q">tes*</str> 
  <str name="qt">dismaxrequest</str> 
  <str name="debugQuery">true</str> 
  <str name="version">2.2</str> 
  </lst>
  </lst>
  <result name="response" numFound="0" start="0" maxScore="0.0" /> 
- <lst name="debug">
  <str name="rawquerystring">tes*</str> 
  <str name="querystring">tes*</str> 
  <str
name="parsedquery">+DisjunctionMaxQuery((programJacketImage_program_s:tes* |
courseCodeSeq_course_s:tes* | authorLastName_product_s:tes* |
Index_Type_s:tes* | prdMainTitle_s:tes*^10.0 | discCode_course_s:tes* |
sourceGroupName_course_s:tes* | indexType_course_s:tes* |
prdMainTitle_product_s:tes* | isbn10_product_s:tes* |
displayName_course_s:tes* | groupNm_program_s:tes* |
discipline_product_s:tes* | courseJacketImage_course_s:tes* |
imprint_product_s:tes* | introText_program_s:tes* |
productType_product_s:tes* | isbn13_product_s:tes* |
copyrightYear_product_s:tes* | prdPubDate_product_s:tes* |
programType_program_s:tes* | editor_product_s:tes* |
courseType_course_s:tes* | productURL_s:tes*^10000.0 |
courseId_course_s:tes* | categoryIds_product_s:tes* |
indexType_program_s:tes* | strapline_product_s:tes* |
subCompany_course_s:tes* | aluminator_product_s:tes* | readBy_product_s:tes*
| subject_product_s:tes* | edition_product_s:tes* |
programId_program_s:tes*)~0.01) () all:english^90.0 all:hindi^123.0
all:glorious^2000.0 all:highlight^1.0E7 all:math^100.0 all:ab^12.0
all:erer^4545.0 MultiPhraseQuery(all:"(prd prd main prd main titl prd main
titl s) (main main titl main titl s) (titl titl s) s"^10.0)
MultiPhraseQuery(all:"(product product url product url s) (url url s)
s"^10000.0)</str> 
  <str name="parsedquery_toString">+(programJacketImage_program_s:tes* |
courseCodeSeq_course_s:tes* | authorLastName_product_s:tes* |
Index_Type_s:tes* | prdMainTitle_s:tes*^10.0 | discCode_course_s:tes* |
sourceGroupName_course_s:tes* | indexType_course_s:tes* |
prdMainTitle_product_s:tes* | isbn10_product_s:tes* |
displayName_course_s:tes* | groupNm_program_s:tes* |
discipline_product_s:tes* | courseJacketImage_course_s:tes* |
imprint_product_s:tes* | introText_program_s:tes* |
productType_product_s:tes* | isbn13_product_s:tes* |
copyrightYear_product_s:tes* | prdPubDate_product_s:tes* |
programType_program_s:tes* | editor_product_s:tes* |
courseType_course_s:tes* | productURL_s:tes*^10000.0 |
courseId_course_s:tes* | categoryIds_product_s:tes* |
indexType_program_s:tes* | strapline_product_s:tes* |
subCompany_course_s:tes* | aluminator_product_s:tes* | readBy_product_s:tes*
| subject_product_s:tes* | edition_product_s:tes* |
programId_program_s:tes*)~0.01 () all:english^90.0 all:hindi^123.0
all:glorious^2000.0 all:highlight^1.0E7 all:math^100.0 all:ab^12.0
all:erer^4545.0 all:"(prd prd main prd main titl prd main titl s) (main main
titl main titl s) (titl titl s) s"^10.0 all:"(product product url product
url s) (url url s) s"^10000.0</str> 
  <lst name="explain" /> 
  <str name="QParser">DismaxQParser</str> 
  <null name="altquerystring" /> 
- <arr name="boost_queries">
  <str>english^90 hindi^123 Glorious^2000 highlighting^10000000 maths^100
ab^12 erer^4545 prdMainTitle_s^10.0 productURL_s^10000.0</str> 
  </arr>
- <arr name="parsed_boost_queries">
  <str>all:english^90.0 all:hindi^123.0 all:glorious^2000.0
all:highlight^1.0E7 all:math^100.0 all:ab^12.0 all:erer^4545.0
MultiPhraseQuery(all:"(prd prd main prd main titl prd main titl s) (main
main titl main titl s) (titl titl s) s"^10.0) MultiPhraseQuery(all:"(product
product url product url s) (url url s) s"^10000.0)</str> 
  </arr>
- <arr name="boostfuncs">
  <str /> 
  </arr>
+ <lst name="timing">
  <double name="time">31.0</double> 
+ <lst name="prepare">
  <double name="time">31.0</double> 
- <lst name="org.apache.solr.handler.component.QueryComponent">
  <double name="time">31.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.FacetComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.HighlightComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.SpellCheckComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.DebugComponent">
  <double name="time">0.0</double> 
  </lst>
  </lst>
- <lst name="process">
  <double name="time">0.0</double> 
- <lst name="org.apache.solr.handler.component.QueryComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.FacetComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.HighlightComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.SpellCheckComponent">
  <double name="time">0.0</double> 
  </lst>
- <lst name="org.apache.solr.handler.component.DebugComponent">
  <double name="time">0.0</double> 
  </lst>
  </lst>
  </lst>
  </lst>
  </response>


Query without wildcard is working fine but query with wildcard is not
returning the results, even though the queries are same.

Please help.

Thanks,
Amit Garg

-- 
View this message in context: 
http://www.nabble.com/Search-wildcards---field-boosting-using-Q-query-tp22282525p22282525.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to