[jira] Created: (SOLR-2152) Apply "filters" to mlt queries without using filters.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (SOLR-2152) Apply "filters" to mlt queries without using filters.

JIRA jira@apache.org
Apply "filters" to mlt queries without using filters.
-----------------------------------------------------

                 Key: SOLR-2152
                 URL: https://issues.apache.org/jira/browse/SOLR-2152
             Project: Solr
          Issue Type: New Feature
          Components: MoreLikeThis
            Reporter: Sven Almgren


We need to provide some additional constraints on the results from MoreLikeThis but would prefer not to trash our caches with short lived filters.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-2152) Apply "filters" to mlt queries without using filters.

JIRA jira@apache.org

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

Sven Almgren commented on SOLR-2152:
------------------------------------

The idea is to inject the additional query around the PriorityQueue created by the MoreLikeThis class. MLT query is basically a big OR'ed query from "interesting terms", and we want to add requirements to this query.

My solution would be to wrap the result from MoreLikeThis.like() with this "constraints query", like how the original document is excluded from the result.

Change

{code}
// exclude current document from results
BooleanQuery mltQuery = new BooleanQuery();
mltQuery.add(mltquery, BooleanClause.Occur.MUST);
mltQuery.add(
    new TermQuery(new Term(uniqueKeyField.getName(), uniqueKeyField.getType().storedToIndexed(doc.getFieldable(uniqueKeyField.getName())))),
        BooleanClause.Occur.MUST_NOT);
{code}

into something like

{code}
BooleanQuery constraint = GetThisQueryFrom("mlt.constraint");
// exclude current document from results
BooleanQuery mltQuery = new BooleanQuery();
mltQuery.add(mltquery, BooleanClause.Occur.MUST);
mltQuery.add(constraint, BooleanClause.Occur.MUST);
mltQuery.add(
    new TermQuery(new Term(uniqueKeyField.getName(), uniqueKeyField.getType().storedToIndexed(doc.getFieldable(uniqueKeyField.getName())))),
        BooleanClause.Occur.MUST_NOT);
{code}


> Apply "filters" to mlt queries without using filters.
> -----------------------------------------------------
>
>                 Key: SOLR-2152
>                 URL: https://issues.apache.org/jira/browse/SOLR-2152
>             Project: Solr
>          Issue Type: New Feature
>          Components: MoreLikeThis
>            Reporter: Sven Almgren
>
> We need to provide some additional constraints on the results from MoreLikeThis but would prefer not to trash our caches with short lived filters.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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