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 Neeti Raj <ne...@gmail.com> on 2008/07/04 09:05:11 UTC

Implementing MoreLikeThis in Ruby

Hi All

Being new to Solr, I am having difficulty trying to figure out how to
use *MoreLikeThis
*feature from my* ruby project*.

I have made the following changes to enable mlt but have been unsuccessful
so far-

 >*Using Solr nightly build dated 1 July 2008*

*SolrConfig.xml*

   <requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
     <lst name="defaults">
       <str name="mlt.fl">channel_name</str>
       <int name="mlt.mindf">1</int>
     </lst>
   </requestHandler>

*schema.xml*
   <!--Added for Morelikethis -->
   <field name="channel_name" type="text" indexed="true" stored="true"
omitNorms="true" termVectors="true" />

*Here is my query for mlt -

*
http://localhost:8983/solr/select?q=BBT&mlt=true&mlt.fl=channel_name&mlt.mindf=1&mlt.mintf=1

*- Response xml has no records in moreLikeThis section and 2 records in
results.

Any help on implementing MLT in ruby would be highly appreciated...

Thanks
Neeti
*

Re: Implementing MoreLikeThis in Ruby

Posted by Neeti Raj <ne...@gmail.com>.
Hi Koji

Thanks for clarifying my understanding about MoreLikeThis.

After your response and reading from Solr Wiki,  I am now successfully using
MoreLikeThis as follows -

   - Using StandardRequestHandler. Removed MoreLikeThisHandler in
   solrconfig.xml.


   -  Modified the query to be -
   http://localhost:8983/solr/select?q=BBT&mlt=true&mlt.fl=*channel_name_t*
   &mlt.mindf=1&mlt.mintf=1<http://localhost:8983/solr/select?q=BBT&mlt=true&mlt.fl=channel_name&mlt.mindf=1&mlt.mintf=1>


   - as I am using Acts_as_solr for talking to Solr which generates dynamic
      fields and hence mlt.fl=channel_name_t


Thanks again for guiding
Neeti

On Mon, Jul 7, 2008 at 8:40 PM, Koji Sekiguchi <ko...@r.email.ne.jp> wrote:

> Neeti,
>
> Do you know:
>
> There are two ways to access MoreLikeThis from solr: from the
> MoreLikeThisHandler
> or with the StandardRequestHandler.
> http://wiki.apache.org/solr/MoreLikeThis
>
> You set MoreLikeThisHandler in your solrconfig.xml:
>
> > <requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
> > <lst name="defaults">
> > <str name="mlt.fl">channel_name</str>
> > <int name="mlt.mindf">1</int>
> > </lst>
> > </requestHandler>
>
> but you were using StandardRequestHandler in your request:
>
> >
> http://localhost:8983/solr/select?q=BBT&mlt=true&mlt.fl=channel_name&mlt.mindf=1&mlt.mintf=1
>
> If you want to use MoreLikeThisHandler you set in your solrconfig.xml,
> specify /mlt
> instead of /select in your request url.
>
> Koji
>
>
>

Re: Implementing MoreLikeThis in Ruby

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
Neeti,

Do you know:

There are two ways to access MoreLikeThis from solr: from the 
MoreLikeThisHandler
or with the StandardRequestHandler.
http://wiki.apache.org/solr/MoreLikeThis

You set MoreLikeThisHandler in your solrconfig.xml:

 > <requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
 > <lst name="defaults">
 > <str name="mlt.fl">channel_name</str>
 > <int name="mlt.mindf">1</int>
 > </lst>
 > </requestHandler>

but you were using StandardRequestHandler in your request:

 > 
http://localhost:8983/solr/select?q=BBT&mlt=true&mlt.fl=channel_name&mlt.mindf=1&mlt.mintf=1

If you want to use MoreLikeThisHandler you set in your solrconfig.xml, 
specify /mlt
instead of /select in your request url.

Koji