Mahout
  1. Mahout
  2. MAHOUT-1312

LocalitySensitiveHashSearch.search does not respect search result limit

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.8
    • Fix Version/s: 0.9
    • Component/s: Math
    • Labels:
      None

      Description

      According to documented org.apache.mahout.math.neighborhood.Searcher, public abstract List<WeightedThing<Vector>> search(Vector query, int limit) contract, limit should be the number of results to return.

      LocalitySensitiveHashSearch implements Searcher but does not respect that contract, as it can return more results than the given limit.

      This issue was encountered while debugging MAHOUT-1302.

        Activity

        Hide
        Dan Filimon added a comment -

        Thanks for pointing this out! I'll have a look at it.
        Do you have a reproducible example / suggestions of where this happened?

        Show
        Dan Filimon added a comment - Thanks for pointing this out! I'll have a look at it. Do you have a reproducible example / suggestions of where this happened?
        Hide
        Stevo Slavic added a comment -

        Always when limit is lower than search size, like in SequenceFilesFromMailArchivesTest.testSequential.

        Show
        Stevo Slavic added a comment - Always when limit is lower than search size, like in SequenceFilesFromMailArchivesTest.testSequential .
        Hide
        Suneel Marthi added a comment -

        Stevo/Dan, can this be reproduced?

        Show
        Suneel Marthi added a comment - Stevo/Dan, can this be reproduced?
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Mahout-Quality #2341 (See https://builds.apache.org/job/Mahout-Quality/2341/)
        MAHOUT-1312: LocalitySensitiveHashSearch does not limit search results (sslavic: rev 1546758)

        • /mahout/trunk/CHANGELOG
        • /mahout/trunk/core/pom.xml
        • /mahout/trunk/core/src/main/java/org/apache/mahout/math/neighborhood/LocalitySensitiveHashSearch.java
        • /mahout/trunk/core/src/test/java/org/apache/mahout/math/neighborhood/SearchSanityTest.java
        • /mahout/trunk/pom.xml
        Show
        Hudson added a comment - SUCCESS: Integrated in Mahout-Quality #2341 (See https://builds.apache.org/job/Mahout-Quality/2341/ ) MAHOUT-1312 : LocalitySensitiveHashSearch does not limit search results (sslavic: rev 1546758) /mahout/trunk/CHANGELOG /mahout/trunk/core/pom.xml /mahout/trunk/core/src/main/java/org/apache/mahout/math/neighborhood/LocalitySensitiveHashSearch.java /mahout/trunk/core/src/test/java/org/apache/mahout/math/neighborhood/SearchSanityTest.java /mahout/trunk/pom.xml
        Hide
        Stevo Slavic added a comment -

        Committed test which reproduces the issue, and fix.

        Resolving as fixed.

        Show
        Stevo Slavic added a comment - Committed test which reproduces the issue, and fix. Resolving as fixed.
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Mahout-Quality #2342 (See https://builds.apache.org/job/Mahout-Quality/2342/)
        MAHOUT-1312: Removed import * and replaced by explicit imports (smarthi: rev 1546765)

        • /mahout/trunk/core/src/test/java/org/apache/mahout/math/neighborhood/SearchSanityTest.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Mahout-Quality #2342 (See https://builds.apache.org/job/Mahout-Quality/2342/ ) MAHOUT-1312 : Removed import * and replaced by explicit imports (smarthi: rev 1546765) /mahout/trunk/core/src/test/java/org/apache/mahout/math/neighborhood/SearchSanityTest.java

          People

          • Assignee:
            Suneel Marthi
            Reporter:
            Stevo Slavic
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development