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

        Stevo Slavic created issue -
        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?
        Suneel Marthi made changes -
        Field Original Value New Value
        Fix Version/s 0.9 [ 12324577 ]
        Stevo Slavic made changes -
        Assignee Dan Filimon [ dfilimon ] Stevo Slavic [ sslavic ]
        Stevo Slavic made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        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
        Stevo Slavic made changes -
        Status In Progress [ 3 ] Open [ 1 ]
        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.
        Stevo Slavic made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        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
        Suneel Marthi made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Stevo Slavic [ sslavic ] Suneel Marthi [ smarthi ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        109d 18h 53m 1 Stevo Slavic 30/Nov/13 17:06
        In Progress In Progress Open Open
        1h 55m 1 Stevo Slavic 30/Nov/13 19:02
        Open Open Resolved Resolved
        41s 1 Stevo Slavic 30/Nov/13 19:03
        Resolved Resolved Closed Closed
        64d 12h 54m 1 Suneel Marthi 03/Feb/14 07:57

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development