Solr
  1. Solr
  2. SOLR-1085

SolrJ client java does not support moreLikeThis querys and results

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 4.9, 5.0
    • Component/s: clients - java
    • Labels:
      None
    • Environment:

      SolrJ java client

      Description

      Although SOLR supports the more like this querys (see http://wiki.apache.org/solr/MoreLikeThis) these type of query are currently not supported by the SOLR java client.

      1. solrj-java-morelikethis.patch
        33 kB
        Maurice Jumelet
      2. SOLR-1085.patch
        21 kB
        Juan Grande
      3. SOLR-1085.4.2.1.patch
        11 kB
        Bill Mitchell

        Activity

        Hide
        Uwe Schindler added a comment -

        Move issue to Solr 4.9.

        Show
        Uwe Schindler added a comment - Move issue to Solr 4.9.
        Hide
        Bill Mitchell added a comment -

        I have relocated the above SOLR-1085 patch to version 4.2.1 (that's the version my shop is running currently). As the earlier version of the patch did a little more than fix this problem – it also added some new entry points that might make MLT easier to use from Java, but these new methods raised some new questions – I removed those and modified the included MLT JUnit test to use just the already defined parameters directly.

        I also updated the JUnit test added to SolrExampleTests to verify that SOLR-5042 has also been fixed. This should not be a problem when relocated to solr 4.6, as that fix is already included there.

        Show
        Bill Mitchell added a comment - I have relocated the above SOLR-1085 patch to version 4.2.1 (that's the version my shop is running currently). As the earlier version of the patch did a little more than fix this problem – it also added some new entry points that might make MLT easier to use from Java, but these new methods raised some new questions – I removed those and modified the included MLT JUnit test to use just the already defined parameters directly. I also updated the JUnit test added to SolrExampleTests to verify that SOLR-5042 has also been fixed. This should not be a problem when relocated to solr 4.6, as that fix is already included there.
        Hide
        Steve Rowe added a comment -

        Bulk move 4.4 issues to 4.5 and 5.0

        Show
        Steve Rowe added a comment - Bulk move 4.4 issues to 4.5 and 5.0
        Hide
        Hoss Man added a comment -

        Bulk of fixVersion=3.6 -> fixVersion=4.0 for issues that have no assignee and have not been updated recently.

        email notification suppressed to prevent mass-spam
        psuedo-unique token identifying these issues: hoss20120321nofix36

        Show
        Hoss Man added a comment - Bulk of fixVersion=3.6 -> fixVersion=4.0 for issues that have no assignee and have not been updated recently. email notification suppressed to prevent mass-spam psuedo-unique token identifying these issues: hoss20120321nofix36
        Hide
        Robert Muir added a comment -

        3.4 -> 3.5

        Show
        Robert Muir added a comment - 3.4 -> 3.5
        Hide
        Juan Grande added a comment -

        Attached is a patch that adds MoreLikeThis support to SolrJ. The patch is for the trunk, but if necessary I can backport it to the 3x branch.

        Show
        Juan Grande added a comment - Attached is a patch that adds MoreLikeThis support to SolrJ. The patch is for the trunk, but if necessary I can backport it to the 3x branch.
        Hide
        Robert Muir added a comment -

        Bulk move 3.2 -> 3.3

        Show
        Robert Muir added a comment - Bulk move 3.2 -> 3.3
        Hide
        Renaud Richardet added a comment -

        For the record, this workaround (proposed from Bruce Ritchie on http://www.mail-archive.com/solr-user@lucene.apache.org/msg14525.html) worked for me:

        #1 - Define the mlt handles in solrconfig.xml (it's not defined in the example
        solrconfig.xml I was using):

        <requestHandler name="/mlt" class="solr.MoreLikeThisHandler" />

        #2 - with Solrj, access the mlt handler via something similar to the following:

        query.setQueryType("/" + MoreLikeThisParams.MLT);
        query.set(MoreLikeThisParams.MATCH_INCLUDE, false);
        query.set(MoreLikeThisParams.MIN_DOC_FREQ, 1);
        query.set(MoreLikeThisParams.MIN_TERM_FREQ, 1);
        query.set(MoreLikeThisParams.SIMILARITY_FIELDS, "subject,body");
        query.setQuery("Your query here or in my case the unique key field:value");

        Show
        Renaud Richardet added a comment - For the record, this workaround (proposed from Bruce Ritchie on http://www.mail-archive.com/solr-user@lucene.apache.org/msg14525.html ) worked for me: #1 - Define the mlt handles in solrconfig.xml (it's not defined in the example solrconfig.xml I was using): <requestHandler name="/mlt" class="solr.MoreLikeThisHandler" /> #2 - with Solrj, access the mlt handler via something similar to the following: query.setQueryType("/" + MoreLikeThisParams.MLT); query.set(MoreLikeThisParams.MATCH_INCLUDE, false); query.set(MoreLikeThisParams.MIN_DOC_FREQ, 1); query.set(MoreLikeThisParams.MIN_TERM_FREQ, 1); query.set(MoreLikeThisParams.SIMILARITY_FIELDS, "subject,body"); query.setQuery("Your query here or in my case the unique key field:value");
        Hide
        Hoss Man added a comment -

        Bulk updating 240 Solr issues to set the Fix Version to "next" per the process outlined in this email...

        http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E

        Selection criteria was "Unresolved" with a Fix Version of 1.5, 1.6, 3.1, or 4.0. email notifications were suppressed.

        A unique token for finding these 240 issues in the future: hossversioncleanup20100527

        Show
        Hoss Man added a comment - Bulk updating 240 Solr issues to set the Fix Version to "next" per the process outlined in this email... http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E Selection criteria was "Unresolved" with a Fix Version of 1.5, 1.6, 3.1, or 4.0. email notifications were suppressed. A unique token for finding these 240 issues in the future: hossversioncleanup20100527
        Hide
        Shalin Shekhar Mangar added a comment -

        Given this patch doesn't alter any existing methods, but instead adds methods to supoort the existing MLT behavior already present in Solr. It would seem wise to get it off the queue and into 1.4 so that it won't get stale.

        Mark, the patch is stale. It does not apply on 1.4 trunk. It is too late in the release cycle to add it to 1.4 but if you or somebody else can sync it with trunk, we can commit it for 1.5.

        Show
        Shalin Shekhar Mangar added a comment - Given this patch doesn't alter any existing methods, but instead adds methods to supoort the existing MLT behavior already present in Solr. It would seem wise to get it off the queue and into 1.4 so that it won't get stale. Mark, the patch is stale. It does not apply on 1.4 trunk. It is too late in the release cycle to add it to 1.4 but if you or somebody else can sync it with trunk, we can commit it for 1.5.
        Hide
        Mark Diggory added a comment -

        Given this patch doesn't alter any existing methods, but instead adds methods to supoort the existing MLT behavior already present in Solr. It would seem wise to get it off the queue and into 1.4 so that it won't get stale.

        Show
        Mark Diggory added a comment - Given this patch doesn't alter any existing methods, but instead adds methods to supoort the existing MLT behavior already present in Solr. It would seem wise to get it off the queue and into 1.4 so that it won't get stale.
        Hide
        Shalin Shekhar Mangar added a comment -

        Marking for 1.5

        Show
        Shalin Shekhar Mangar added a comment - Marking for 1.5
        Hide
        Shalin Shekhar Mangar added a comment -

        Maurice, this patch is based on the 1.3.0 release branch. There has been a lot of changes in the code base since that release. Can you please provide one which applies on the trunk?

        Also, there seems to be some character encoding issues in the patch. Can you make sure that you use UTF-8?

        Show
        Shalin Shekhar Mangar added a comment - Maurice, this patch is based on the 1.3.0 release branch. There has been a lot of changes in the code base since that release. Can you please provide one which applies on the trunk? Also, there seems to be some character encoding issues in the patch. Can you make sure that you use UTF-8?
        Hide
        Maurice Jumelet added a comment -

        Attached is a patch that adds minimal support to the solr java client for morelikethis support.

        Tobe done: add all query parameters as defined at: http://wiki.apache.org/solr/MoreLikeThis

        Show
        Maurice Jumelet added a comment - Attached is a patch that adds minimal support to the solr java client for morelikethis support. Tobe done: add all query parameters as defined at: http://wiki.apache.org/solr/MoreLikeThis

          People

          • Assignee:
            Unassigned
            Reporter:
            Maurice Jumelet
          • Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:

              Development