function queries scope
Hi, I need to use the function queries operations with the score of a given query, but only in the docset that i get from the query and i dont know if this is possible. Example: q=shops in madridreturns 1 docs with a specific score for each doc but now i need to do some stuff like q=sum(product(2,query(shops in madrid),productValueField) but this will be return all the docs in my index. I know that i can do it via filter queries, ex, q=sum(product(2,query(shops in madrid),productValueField)&fq=shops in madrid but this will do the query two times and i dont want this because the performance is important to our application. Is there other approach to accomplished that= Thanks in advance, Marco Martínez Bautista http://www.paradigmatecnologico.com Avenida de Europa, 26. Ática 5. 3ª Planta 28224 Pozuelo de Alarcón Tel.: 91 352 59 42
Re: function queries scope
One way is to use the boost qparser: http://search-lucene.com/jd/solr/org/apache/solr/search/BoostQParserPlugin.html q={!boost b=productValueField}shops in madrid Or you can use the edismax parser which as a "boost" parameter that does the same thing: defType=edismax&q=shops in madrid&boost=productValueField -Yonik http://www.lucidimagination.com On Tue, Jun 7, 2011 at 6:53 AM, Marco Martinez wrote: > Hi, > > I need to use the function queries operations with the score of a given > query, but only in the docset that i get from the query and i dont know if > this is possible. > > Example: > > q=shops in madrid returns 1 docs with a specific score for each doc > > but now i need to do some stuff like > > q=sum(product(2,query(shops in madrid),productValueField) but this will be > return all the docs in my index. > > > I know that i can do it via filter queries, ex, q=sum(product(2,query(shops > in madrid),productValueField)&fq=shops in madrid but this will do the query > two times and i dont want this because the performance is important to our > application. > > > Is there other approach to accomplished that= > > > Thanks in advance, > > Marco Martínez Bautista > http://www.paradigmatecnologico.com > Avenida de Europa, 26. Ática 5. 3ª Planta > 28224 Pozuelo de Alarcón > Tel.: 91 352 59 42 >
Re: function queries scope
Thanks, but its not what i'm looking for, because the BoostQParserPlugin multiplies the score of the query with the function queries defined in the b param of the BoostQParserPlugin. and i can't use the edismax because we have our own qparser. Its seems that i have to code another qparser. Thanks Yonik anyway, Marco Martínez Bautista http://www.paradigmatecnologico.com Avenida de Europa, 26. Ática 5. 3ª Planta 28224 Pozuelo de Alarcón Tel.: 91 352 59 42 2011/6/7 Yonik Seeley > One way is to use the boost qparser: > > http://search-lucene.com/jd/solr/org/apache/solr/search/BoostQParserPlugin.html > q={!boost b=productValueField}shops in madrid > > Or you can use the edismax parser which as a "boost" parameter that > does the same thing: > defType=edismax&q=shops in madrid&boost=productValueField > > > -Yonik > http://www.lucidimagination.com > > > On Tue, Jun 7, 2011 at 6:53 AM, Marco Martinez > wrote: > > Hi, > > > > I need to use the function queries operations with the score of a given > > query, but only in the docset that i get from the query and i dont know > if > > this is possible. > > > > Example: > > > > q=shops in madridreturns 1 docs with a specific score for each > doc > > > > but now i need to do some stuff like > > > > q=sum(product(2,query(shops in madrid),productValueField) but this will > be > > return all the docs in my index. > > > > > > I know that i can do it via filter queries, ex, > q=sum(product(2,query(shops > > in madrid),productValueField)&fq=shops in madrid but this will do the > query > > two times and i dont want this because the performance is important to > our > > application. > > > > > > Is there other approach to accomplished that= > > > > > > Thanks in advance, > > > > Marco Martínez Bautista > > http://www.paradigmatecnologico.com > > Avenida de Europa, 26. Ática 5. 3ª Planta > > 28224 Pozuelo de Alarcón > > Tel.: 91 352 59 42 > > >