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 entdeveloper <ca...@gmail.com> on 2012/06/12 01:13:31 UTC

Something like 'bf' or 'bq' with MoreLikeThis

I'm looking for a way to improve the relevancy of my MLT results. For my
index based on movies, the MoreLikeThisHandler is doing a great job of
returning related documents by the fields I specify like 'genre', but within
my "bands" of results (groups of documents with the same score cause they
all match on the mlt.fl and mlt.qf params), there's nothing else to sort the
results /within/ those "bands".

A good way to help this would be to have a
bf=recip(rord(created_at),1,1000,1000), so the newer movies should up
higher, but I don't think the MLT handler supports bf or bq. Is there
something similar I could use that would accomplish the same thing, maybe
using the _val_: hook somewhere?

--
View this message in context: http://lucene.472066.n3.nabble.com/Something-like-bf-or-bq-with-MoreLikeThis-tp3989060.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Something like 'bf' or 'bq' with MoreLikeThis

Posted by nanshi <na...@gmail.com>.
Amit, I am using Solr3.6 and directly imported apache-solr-3.6.0.war into
Eclipse (Indigo). I will need to directly invoke a MoreLikeThis(/mlt) call
using a unique id to get MoreLikeThis results. 

The hard part is that I need to use a float number field (that i cannot use
mlt.fl or mlt.fq since it's not a string) in the matched document of the MLT
response to find MLT results - this is purely for relevance improvement. 

I found a work around that I can use a standard query parameter
fq=Rating:[1.5 TO 2.5]; however, for the run time queries, i have to extract
the rating number from the matched doc(/mlt?q=id:12345) that i dont know how
to extract this at run time.... If the matched rating is 2, for instance,
then i can construct [1.5 TO 2.5] to say that 2 is more like a value within
the range from 1.5 to 2.5....So, the same thing i will encounter if i use a
bf parameter to calculate distance, i will still need to get the Rating
value out of the matched document.


--
View this message in context: http://lucene.472066.n3.nabble.com/Something-like-bf-or-bq-with-MoreLikeThis-tp3989060p3993079.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Something like 'bf' or 'bq' with MoreLikeThis

Posted by Amit Nithian <an...@gmail.com>.
No worries! What version of Solr are you using? One that you
downloaded as a tarball or one that you checked out from SVN (trunk)?
I'll take a bit of time and document steps and respond.

I'll review the patch to see that it fits a general case. Question for
you with MLT, are your users doing a blank search (no text) for
something or are you returning results More Like results that were
generated as a result of a user typing some text query. I may have
built this patch assuming a blank query but I can make it work (or try
to) make it work for text based queries.

Thanks
Amit

On Wed, Jul 4, 2012 at 1:37 AM, nanshi <na...@gmail.com> wrote:
> Thanks a lot, Amit! Please bear with me, I am a new Solr dev, could you
> please shed me some light on how to use a patch? point me to a wiki/doc is
> fine too. Thanks a lot! :)
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Something-like-bf-or-bq-with-MoreLikeThis-tp3989060p3992935.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Something like 'bf' or 'bq' with MoreLikeThis

Posted by nanshi <na...@gmail.com>.
Thanks a lot, Amit! Please bear with me, I am a new Solr dev, could you
please shed me some light on how to use a patch? point me to a wiki/doc is
fine too. Thanks a lot! :)

--
View this message in context: http://lucene.472066.n3.nabble.com/Something-like-bf-or-bq-with-MoreLikeThis-tp3989060p3992935.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Something like 'bf' or 'bq' with MoreLikeThis

Posted by Amit Nithian <an...@gmail.com>.
I had a similar problem so I submitted this patch:
https://issues.apache.org/jira/browse/SOLR-2351

I haven't applied this to trunk in a while but my goal was to ensure
that bf parameters were passed down and respected by the MLT handler.
Let me know if this works for you or not. If there is sufficient
interest, I'll re-apply this patch to trunk and try and devise some
tests.

Thanks!
Amit

On Tue, Jul 3, 2012 at 5:08 PM, nanshi <na...@gmail.com> wrote:
> Jack, can you please explain this in some more detail? Such as how to write
> my own search component to modify request to add bq parameter and get
> customized result back?
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Something-like-bf-or-bq-with-MoreLikeThis-tp3989060p3992888.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Something like 'bf' or 'bq' with MoreLikeThis

Posted by nanshi <na...@gmail.com>.
Jack, can you please explain this in some more detail? Such as how to write
my own search component to modify request to add bq parameter and get
customized result back?

--
View this message in context: http://lucene.472066.n3.nabble.com/Something-like-bf-or-bq-with-MoreLikeThis-tp3989060p3992888.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Something like 'bf' or 'bq' with MoreLikeThis

Posted by Jack Krupansky <ja...@basetechnology.com>.
The MLT handler may not have those params, but you could use the MLT search 
"component" to generate the MLT queries (and results) and then add your own 
component that would revise the MLT queries to be boosted as you desire.

-- Jack Krupansky

-----Original Message----- 
From: entdeveloper
Sent: Monday, June 11, 2012 7:13 PM
To: solr-user@lucene.apache.org
Subject: Something like 'bf' or 'bq' with MoreLikeThis

I'm looking for a way to improve the relevancy of my MLT results. For my
index based on movies, the MoreLikeThisHandler is doing a great job of
returning related documents by the fields I specify like 'genre', but within
my "bands" of results (groups of documents with the same score cause they
all match on the mlt.fl and mlt.qf params), there's nothing else to sort the
results /within/ those "bands".

A good way to help this would be to have a
bf=recip(rord(created_at),1,1000,1000), so the newer movies should up
higher, but I don't think the MLT handler supports bf or bq. Is there
something similar I could use that would accomplish the same thing, maybe
using the _val_: hook somewhere?

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Something-like-bf-or-bq-with-MoreLikeThis-tp3989060.html
Sent from the Solr - User mailing list archive at Nabble.com.