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 Furkan KAMACI <fu...@gmail.com> on 2013/12/01 17:52:59 UTC

Using Payloads as a Coefficient For Score At a Custom QParser That extends ExtendedDismaxQParser

Hi;

I use Solr 4.5.1 I have a case: When a user searches for some specific
keywords some documents should be listed at much more higher than its usual
score. I mean I have probabilities of which documents user may want to see
for given keywords.

I have come up with that idea. I can put a new field to my schema. This
field holds keyword and probability as payload. When a user searches for a
keyword I will calculate usual document score for given fields and also I
will make a search on payloaded field and I will multiply the total score
with that payload.

I followed that example:
http://sujitpal.blogspot.com/2013/07/porting-payloads-to-solr4.html#! owever
that example extends Qparser directly but I want to use capabilities of
edismax.

So I found that example:
http://digitalpebble.blogspot.com/2010/08/using-payloads-with-dismaxqparser-in.html
his
one exteds dismax and but I could not used payloads at that example.

I want to combine above to solutions. First solution has that case:

@Override
    public Similarity get(String name) {
        if ("payloads".equals(name) || "cscores".equals(name)) {
            return new PayloadSimilarity();
        } else {
            return new DefaultSimilarity();
        }
    }

However dismax behaves different. i.e. when you search for cscores:A it
changes that into that:

*+((text:cscores:y text:cscores text:y text:cscoresy)) ()*

When I debug it name is text instead of cscores and does not work. My idea
is combining two examples and extending edismax. Do you have any idea how
to extend it for edismax or do you have any idea what to do for my case.

*PS:* I've sent same question at Lucene user list too. I ask it here to get
an idea from Solr perspective too.

Thanks;
Furkan KAMACI

Re: Using Payloads as a Coefficient For Score At a Custom QParser That extends ExtendedDismaxQParser

Posted by Furkan KAMACI <fu...@gmail.com>.
Hi Joel;

Of course I will share my codes with  Solr as like before. I will explain
my use case in detail and my solution. I will fire a Jira (Erick Hatcher
had created a similar Jira 4 years ago, I will link it too). I will write
to mail list when I applied my patch.

Thanks;
Furkan KAMACI


2013/12/4 Joel Bernstein <jo...@gmail.com>

> Sounds great Furkan,
>
> Do you have the permission to donate this code? I would be great if you
> could create a JIra ticket.
>
> Thanks,
> Joel
>
>
> On Tue, Dec 3, 2013 at 3:26 PM, Furkan KAMACI <furkankamaci@gmail.com
> >wrote:
>
> > I've implemented what I want. I can add payload score into the document
> > score. I've modified ExtendedDismaxQParser and I can use all the
> abilities
> > of edismax at my case. I will explain what I did at my blog.
> >
> > Thanks;
> > Furkan KAMACI
> >
> >
> > 2013/12/1 Furkan KAMACI <fu...@gmail.com>
> >
> > > Hi;
> > >
> > > I use Solr 4.5.1 I have a case: When a user searches for some specific
> > > keywords some documents should be listed at much more higher than its
> > usual
> > > score. I mean I have probabilities of which documents user may want to
> > see
> > > for given keywords.
> > >
> > > I have come up with that idea. I can put a new field to my schema. This
> > > field holds keyword and probability as payload. When a user searches
> for
> > a
> > > keyword I will calculate usual document score for given fields and
> also I
> > > will make a search on payloaded field and I will multiply the total
> score
> > > with that payload.
> > >
> > > I followed that example:
> > > http://sujitpal.blogspot.com/2013/07/porting-payloads-to-solr4.html#!
> > owever
> > > that example extends Qparser directly but I want to use capabilities of
> > > edismax.
> > >
> > > So I found that example:
> > >
> >
> http://digitalpebble.blogspot.com/2010/08/using-payloads-with-dismaxqparser-in.htmlhis
> > > one exteds dismax and but I could not used payloads at that example.
> > >
> > > I want to combine above to solutions. First solution has that case:
> > >
> > > @Override
> > >     public Similarity get(String name) {
> > >         if ("payloads".equals(name) || "cscores".equals(name)) {
> > >             return new PayloadSimilarity();
> > >         } else {
> > >             return new DefaultSimilarity();
> > >         }
> > >     }
> > >
> > > However dismax behaves different. i.e. when you search for cscores:A it
> > > changes that into that:
> > >
> > > *+((text:cscores:y text:cscores text:y text:cscoresy)) ()*
> > >
> > > When I debug it name is text instead of cscores and does not work. My
> > idea
> > > is combining two examples and extending edismax. Do you have any idea
> how
> > > to extend it for edismax or do you have any idea what to do for my
> case.
> > >
> > > *PS:* I've sent same question at Lucene user list too. I ask it here to
> > > get an idea from Solr perspective too.
> > >
> > > Thanks;
> > > Furkan KAMACI
> > >
> >
>
>
>
> --
> Joel Bernstein
> Search Engineer at Heliosearch
>

Re: Using Payloads as a Coefficient For Score At a Custom QParser That extends ExtendedDismaxQParser

Posted by Joel Bernstein <jo...@gmail.com>.
Sounds great Furkan,

Do you have the permission to donate this code? I would be great if you
could create a JIra ticket.

Thanks,
Joel


On Tue, Dec 3, 2013 at 3:26 PM, Furkan KAMACI <fu...@gmail.com>wrote:

> I've implemented what I want. I can add payload score into the document
> score. I've modified ExtendedDismaxQParser and I can use all the abilities
> of edismax at my case. I will explain what I did at my blog.
>
> Thanks;
> Furkan KAMACI
>
>
> 2013/12/1 Furkan KAMACI <fu...@gmail.com>
>
> > Hi;
> >
> > I use Solr 4.5.1 I have a case: When a user searches for some specific
> > keywords some documents should be listed at much more higher than its
> usual
> > score. I mean I have probabilities of which documents user may want to
> see
> > for given keywords.
> >
> > I have come up with that idea. I can put a new field to my schema. This
> > field holds keyword and probability as payload. When a user searches for
> a
> > keyword I will calculate usual document score for given fields and also I
> > will make a search on payloaded field and I will multiply the total score
> > with that payload.
> >
> > I followed that example:
> > http://sujitpal.blogspot.com/2013/07/porting-payloads-to-solr4.html#!
> owever
> > that example extends Qparser directly but I want to use capabilities of
> > edismax.
> >
> > So I found that example:
> >
> http://digitalpebble.blogspot.com/2010/08/using-payloads-with-dismaxqparser-in.htmlhis
> > one exteds dismax and but I could not used payloads at that example.
> >
> > I want to combine above to solutions. First solution has that case:
> >
> > @Override
> >     public Similarity get(String name) {
> >         if ("payloads".equals(name) || "cscores".equals(name)) {
> >             return new PayloadSimilarity();
> >         } else {
> >             return new DefaultSimilarity();
> >         }
> >     }
> >
> > However dismax behaves different. i.e. when you search for cscores:A it
> > changes that into that:
> >
> > *+((text:cscores:y text:cscores text:y text:cscoresy)) ()*
> >
> > When I debug it name is text instead of cscores and does not work. My
> idea
> > is combining two examples and extending edismax. Do you have any idea how
> > to extend it for edismax or do you have any idea what to do for my case.
> >
> > *PS:* I've sent same question at Lucene user list too. I ask it here to
> > get an idea from Solr perspective too.
> >
> > Thanks;
> > Furkan KAMACI
> >
>



-- 
Joel Bernstein
Search Engineer at Heliosearch

Re: Using Payloads as a Coefficient For Score At a Custom QParser That extends ExtendedDismaxQParser

Posted by Furkan KAMACI <fu...@gmail.com>.
I've implemented what I want. I can add payload score into the document
score. I've modified ExtendedDismaxQParser and I can use all the abilities
of edismax at my case. I will explain what I did at my blog.

Thanks;
Furkan KAMACI


2013/12/1 Furkan KAMACI <fu...@gmail.com>

> Hi;
>
> I use Solr 4.5.1 I have a case: When a user searches for some specific
> keywords some documents should be listed at much more higher than its usual
> score. I mean I have probabilities of which documents user may want to see
> for given keywords.
>
> I have come up with that idea. I can put a new field to my schema. This
> field holds keyword and probability as payload. When a user searches for a
> keyword I will calculate usual document score for given fields and also I
> will make a search on payloaded field and I will multiply the total score
> with that payload.
>
> I followed that example:
> http://sujitpal.blogspot.com/2013/07/porting-payloads-to-solr4.html#! owever
> that example extends Qparser directly but I want to use capabilities of
> edismax.
>
> So I found that example:
> http://digitalpebble.blogspot.com/2010/08/using-payloads-with-dismaxqparser-in.html his
> one exteds dismax and but I could not used payloads at that example.
>
> I want to combine above to solutions. First solution has that case:
>
> @Override
>     public Similarity get(String name) {
>         if ("payloads".equals(name) || "cscores".equals(name)) {
>             return new PayloadSimilarity();
>         } else {
>             return new DefaultSimilarity();
>         }
>     }
>
> However dismax behaves different. i.e. when you search for cscores:A it
> changes that into that:
>
> *+((text:cscores:y text:cscores text:y text:cscoresy)) ()*
>
> When I debug it name is text instead of cscores and does not work. My idea
> is combining two examples and extending edismax. Do you have any idea how
> to extend it for edismax or do you have any idea what to do for my case.
>
> *PS:* I've sent same question at Lucene user list too. I ask it here to
> get an idea from Solr perspective too.
>
> Thanks;
> Furkan KAMACI
>