Hi,

select?br="2"+"3"&version=2&fl=id,level,name,city,amenities,$lanorm,$relscore,$bscore&q=*:*&fq={!lucene
q.op=OR df=property_type v=$ptype}&ptype=1&fq={!lucene q.op=OR df=city
v=$cit}&sort=$bscore desc,$relscore
desc&cit=Chennai&relscore=product($banorm,15)&bscore=banorm($la,amenities,10)&la=8

this is the sample query.

banorm($la,amenities,10) , banorm is the custom function,la is the user
input and 10 is some constant vale.

if la=8 then the results should be,and it is working fine

name:ABC
city: "Chennai",
propertyType: [1],
baNorm: 0.4,
relScore: 6,
bScore: 3001

name:XYZ
city: "Chennai",
propertyType: [1],
baNorm: 0.4,
relScore: 6,
bScore: 3001

name:PQR
city: "Chennai",
propertyType: [1],
baNorm: 0,
relScore: 0,
bScore: 2001

if we are changing the la to 24(i.e la=24) again the results are being
displayed in the same order as first query but the bscore and relscore
values are different,which means the result is not sorted.

select?br="2"+"3"&version=2&fl=id,level,name,city,amenities,$lanorm,$relscore,$bscore&q=*:*&fq={!lucene
q.op=OR df=property_type v=$ptype}&ptype=1&fq={!lucene q.op=OR df=city
v=$cit}&sort=$bscore desc,$relscore
desc&cit=Chennai&relscore=product($banorm,15)&bscore=banorm($la,amenities,10)&la=24

name:ABC
city: "Chennai",
propertyType: [1],
baNorm: 0,
relScore: 0,
bScore: 2001

name:XYZ
city: "Chennai",
propertyType: [1],
baNorm: 0.6,
relScore: 9,
bScore: 4001

name:PQR
city: "Chennai",
propertyType: [1],
baNorm: 0.4,
relScore: 6,
bScore: 3001


Thanks & Regards,
Senthilnathan V


On Mon, Feb 24, 2014 at 7:04 PM, Shalin Shekhar Mangar <
shalinman...@gmail.com> wrote:

> Please provide the *Solr* queries that are being invoked by your
> middle layer along with the results you expect and the results you
> actually got from Solr with cache-enabled.
>
> On Mon, Feb 24, 2014 at 6:23 PM, Senthilnathan Vijayaraja
> <senthilnat...@8kmiles.com> wrote:
> > Below is the url which will hit the middle layer then middle layer will
> > form the solr query and fire it.
> >
> >
> *listing?offset=0&sortparam=0&limit=20&q=Chennai~Tambaram~1~2,3~450000~25000000~800~2000~~24*
> >
> >
> > Chennai-->city
> > Tambaram-->locality
> > 1-->blah
> > 2,3-->blah
> > 450000~25000000-->price_min and max
> > 800~2000-->area min and max
> > *24--lux_ amenities*
> >
> > here other than lux_amenities I am using fq for all other things,so the
> > problem here is sorting.
> >
> > I am sorting the results using bscore and relscore likebelow,
> >
> > <str name="sort">*$bscore desc,$relscore desc*</str>
> >
> > first time it works fine.
> >
> > above bscore and relscore will change based on lux_amenities but
> > lux_amenities is neither part of fq  nor q.So if second time we are
> > changing the lux_amenities alone and firing the query means it is giving
> > the result in same order as first query even the bscore and relscore are
> > different.
> >
> > So I disabled the queryResultCache,
> >
> > <!--        <queryResultCache class="solr.LRUCache" size="512"
> >             initialSize="512" autowarmCount="0" />             -->
> >
> > Now it is working fine. But I need a better solution than disabling this
> > for all queries.For eg, I want to disable this for few queries alone not
> > for all.
> >
> >
> > Could someone help me please..
> >
> >
> > Thanks & Regards,
> > Senthilnathan V
>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Reply via email to