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 dabboo <ag...@sapient.com> on 2009/03/05 14:31:45 UTC

Column Query with q query Parameter

Hi,

I am implementing column specific search with q query parameter. I have
achieved the same but field boosting is not working in that.

Below is the query which is getting formed for this URL:

/?q=productURL_s:amit%20OR%20prdMainTitle_s:amitg&version=2.2&start=0&rows=10&indent=on&qt=dismaxrequest

Query:

productURL_s:amit prdMainTitle_s:amitg

It is fetching the records, which mataches this criteria but it doesnt
honour the field boosting. 
Can someone please tell me what query should be formed in order to get field
boosting running.

Thanks,
Amit Garg
-- 
View this message in context: http://www.nabble.com/Column-Query-with-q-query-Parameter-tp22351678p22351678.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Column Query with q query Parameter

Posted by dabboo <ag...@sapient.com>.
Erik,

Thanks for the information. I understand that it is revolving around
q/q.alt/dismax but as per my need, I have to do some customization and I
have to use dismax for the same. That;s the reason , I keep asking different
questions about the same.

Below is the dismax configuration from SolrConfig file.

<requestHandler name="dismaxrequest" class="solr.DisMaxRequestHandler" > 
    <lst name="defaults"> 
    	  <!-- omp = Only More Popular -->
          <str name="spellcheck.onlyMorePopular">false</str>
          <!-- exr = Extended Results -->
          <str name="spellcheck.extendedResults">true</str>
          <!--  The number of suggestions to return -->
          <str name="spellcheck.count">10</str>
      
     <str name="echoParams">explicit</str> 
  
     <float name="tie">0.01</float> 
     <str name="qf">isbn10_product_s^1.0 isbn13_product_s^1.0
Index_Type_s^1.0 prdMainTitle_s^10000.0 productURL_s^10.0
prdMainTitle_product_s^1.0 categoryIds_product_s^1.0 imprint_product_s^1.0
strapline_product_s^1.0 subject_product_s^1.0 prdPubDate_product_s^1.0
readBy_product_s^1.0 aluminator_product_s^1.0 editor_product_s^1.0
productType_product_s^1.0 authorLastName_product_s^1.0 edition_product_s^1.0
discipline_product_s^1.0 copyrightYear_product_s^1.0 courseId_course_s^1.0
indexType_course_s^1.0 courseType_course_s^1.0
courseJacketImage_course_s^1.0 sourceGroupName_course_s^1.0
subCompany_course_s^1.0 courseCodeSeq_course_s^1.0 discCode_course_s^1.0
displayName_course_s^1.0 programId_program_s^1.0 indexType_program_s^1.0
programType_program_s^1.0 groupNm_program_s^1.0 introText_program_s^1.0
programJacketImage_program_s^1.0</str> 
        
     <str name="pf"> 
     
     </str> 
	<str name="bf"> 
	
	</str>
	 <str name="bq">english^90 hindi^123 Glorious^2000 highlighting^10000000
maths^100 ab^12 erer^4545 prdMainTitle_s^10.0 productURL_s^10000.0</str>
     <str name="fl"> 
        *,score 
     </str> 
    </lst> 
     <arr name="last-components">
          <str>spellcheck</str>
    </arr>
  </requestHandler>


Debug Query with field Operations 

<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">productURL_s:amit OR prdMainTitle_s:amitg</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="9.245665E-8">
−
<doc>
<float name="score">9.245665E-8</float>
<str name="IndexId_s">987644333221</str>
<str name="IndexId_str_s">987644333221</str>
<str name="productURL_s">amit</str>
<str name="productURL_str_s">amit</str>
</doc>
−
<doc>
<float name="score">9.245665E-8</float>
<str name="IndexId_s">9876533221</str>
<str name="IndexId_str_s">9876533221</str>
<str name="prdMainTitle_s">amitg</str>
<str name="prdMainTitle_str_s">amitg</str>
</doc>
</result>
−
<lst name="debug">
<str name="rawquerystring">productURL_s:amit OR prdMainTitle_s:amitg</str>
<str name="querystring">productURL_s:amit OR prdMainTitle_s:amitg</str>
−
<str name="parsedquery">
+(productURL_s:amit prdMainTitle_s:amitg) () 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">
+(productURL_s:amit prdMainTitle_s:amitg) () 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="987644333221">

9.245665E-8 = (MATCH) sum of:
  9.245665E-8 = (MATCH) product of:
    1.849133E-7 = (MATCH) sum of:
      1.849133E-7 = (MATCH) weight(productURL_s:amit in 6), product of:
        7.748973E-8 = queryWeight(productURL_s:amit), product of:
          2.3862944 = idf(docFreq=1, numDocs=8)
          3.247283E-8 = queryNorm
        2.3862944 = (MATCH) fieldWeight(productURL_s:amit in 6), product of:
          1.0 = tf(termFreq(productURL_s:amit)=1)
          2.3862944 = idf(docFreq=1, numDocs=8)
          1.0 = fieldNorm(field=productURL_s, doc=6)
    0.5 = coord(1/2)
</str>
−
<str name="9876533221">

9.245665E-8 = (MATCH) sum of:
  9.245665E-8 = (MATCH) product of:
    1.849133E-7 = (MATCH) sum of:
      1.849133E-7 = (MATCH) weight(prdMainTitle_s:amitg in 7), product of:
        7.748973E-8 = queryWeight(prdMainTitle_s:amitg), product of:
          2.3862944 = idf(docFreq=1, numDocs=8)
          3.247283E-8 = queryNorm
        2.3862944 = (MATCH) fieldWeight(prdMainTitle_s:amitg in 7), product
of:
          1.0 = tf(termFreq(prdMainTitle_s:amitg)=1)
          2.3862944 = idf(docFreq=1, numDocs=8)
          1.0 = fieldNorm(field=prdMainTitle_s, doc=7)
    0.5 = coord(1/2)
</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> 
	
	</str>
</arr>
−
<lst name="timing">
<double name="time">31.0</double>
−
<lst name="prepare">
<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 name="process">
<double name="time">31.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">16.0</double>
</lst>
</lst>
</lst>
</lst>
</response>


I am able to achieve the field operations, wildcard with q query. But with
field operations, field boosting is not working.

If required, I can write you a separate email.
Please suggest.

Thanks,
Amit Garg




Erik Hatcher wrote:
> 
> 
> On Mar 5, 2009, at 8:31 AM, dabboo wrote:
>> I am implementing column specific search with q query parameter. I  
>> have
>> achieved the same but field boosting is not working in that.
>>
>> Below is the query which is getting formed for this URL:
>>
>> /?q=productURL_s:amit%20OR 
>> %20prdMainTitle_s:amitg 
>> &version=2.2&start=0&rows=10&indent=on&qt=dismaxrequest
>>
>> Query:
>>
>> productURL_s:amit prdMainTitle_s:amitg
>>
>> It is fetching the records, which mataches this criteria but it doesnt
>> honour the field boosting.
>> Can someone please tell me what query should be formed in order to  
>> get field
>> boosting running.
> 
> 
> Amit - it seems we keep revisiting the same question about q/q.alt/ 
> dismax.
> 
> Please provide complete details - what does your dismaxrequest handler  
> config look like?  What does debugQuery=true parsed query output say?
> 
> If you're using the dismax parser, your field selections aren't going  
> to work, nor is the OR syntax.   For details, look at the dismax and  
> solr query parser pages on the Solr wiki and that'll hopefully clarify  
> some things.
> 
> 	Erik
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Column-Query-with-q-query-Parameter-tp22351678p22366659.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Column Query with q query Parameter

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Mar 5, 2009, at 8:31 AM, dabboo wrote:
> I am implementing column specific search with q query parameter. I  
> have
> achieved the same but field boosting is not working in that.
>
> Below is the query which is getting formed for this URL:
>
> /?q=productURL_s:amit%20OR 
> %20prdMainTitle_s:amitg 
> &version=2.2&start=0&rows=10&indent=on&qt=dismaxrequest
>
> Query:
>
> productURL_s:amit prdMainTitle_s:amitg
>
> It is fetching the records, which mataches this criteria but it doesnt
> honour the field boosting.
> Can someone please tell me what query should be formed in order to  
> get field
> boosting running.


Amit - it seems we keep revisiting the same question about q/q.alt/ 
dismax.

Please provide complete details - what does your dismaxrequest handler  
config look like?  What does debugQuery=true parsed query output say?

If you're using the dismax parser, your field selections aren't going  
to work, nor is the OR syntax.   For details, look at the dismax and  
solr query parser pages on the Solr wiki and that'll hopefully clarify  
some things.

	Erik