[ 
https://issues.apache.org/jira/browse/SOLR-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13741184#comment-13741184
 ] 

Kranti Parisa commented on SOLR-5160:
-------------------------------------

Yes, AND will help to get MLT documents based on the criteria. the criteria 
could be I want to get similar documents whose values are same as the original 
document. for example: all products manufactured in 2013 + mobiles category 
(these are attributes of the original document for which we are trying to find 
exact matches). And if the use case is to get either manufactured in 2013 OR 
mobiles category, then we can ask for OR.

Hence, I think allowing the user to specify the operator (mlt.operator or 
something) will help them get MLT documents based on their criteria and the 
results can be sorted based on mlt.sort
                
> MoreLikeThis (MLT) - New Optional Params -  mlt.operator & mlt.sort
> -------------------------------------------------------------------
>
>                 Key: SOLR-5160
>                 URL: https://issues.apache.org/jira/browse/SOLR-5160
>             Project: Solr
>          Issue Type: Improvement
>          Components: MoreLikeThis
>            Reporter: Kranti Parisa
>            Priority: Minor
>              Labels: features
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> It seems that when we pass multiple field names with mlt.fl parameter, it is 
> ORing them to find the MLT documents.
> Is there a way to specify AND operator? Means if mlt.fl=language,year, then 
> we should return back the MLT documents which has language AND year field 
> values as same as the main query result document.
> http://localhost:8180/solr/mltCore/mlt?q=id:111111111&wt=json&mlt=true&mlt.fl=language,year&fl=*,score&mlt.mindf=0&mlt.mintf=0&mlt.match.include=false
> The above query should return those documents whose field values (language, 
> year) are exactly matching with the document id:111111111.
> Is this possible thru any config or param? If not, I think it's worth having 
> as a feature because we don't know the values of those fields to apply as FQ. 
>  was looking at the code and found that it is hard coded to Occur.SHOULD in 
> MoreLikeThisQuery.
> I customized the code to pass a new parameter mlt.operator=AND/OR  based on 
> that it computes the MLT documents. Default operator is set to OR.
> And I also want to have mlt.sort option, So I will be trying for that as well.
> Do you guys think, we should make this part of the MLT feature? 
> Please share your ideas. I can submit this change.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to