Coder Social home page Coder Social logo

Comments (6)

peterjkirby avatar peterjkirby commented on September 22, 2024

I'm seeing this error as well. @chenzk1993 did you happen to identify the root cause?

from milvus-sdk-java.

xiaofan-luan avatar xiaofan-luan commented on September 22, 2024

did you try latest java SDK?

from milvus-sdk-java.

xiaofan-luan avatar xiaofan-luan commented on September 22, 2024

which is 2.2.5, use milvus version 2.2.8

from milvus-sdk-java.

peterjkirby avatar peterjkirby commented on September 22, 2024

@xiaofan-luan Yes, I'm using managed Milvus (Zilliz) and the latest Java SDK version.

Some additional information that might help narrow down the cause:

  • The collections we are searching are very small right now (my team is building some demos and POCs to familiarize ourselves with Milvus, so we are keeping our dataset size small for the time being).
  • We are performing hybrid searches

The exception is being thrown when calling the SearchResultsWrapper.getIDScore() method

    public List<IDScore> getIDScore(int indexOfTarget) throws ParamException, IllegalResponseException {
        Position position = getOffsetByIndex(indexOfTarget);

        long offset = position.getOffset();
        long k = position.getK();
        if (offset + k > results.getScoresCount()) {
            throw new IllegalResponseException("Result scores count is wrong");
        }

        List<IDScore> idScore = new ArrayList<>();

        IDs ids = results.getIds();
        if (ids.hasIntId()) {
            LongArray longIDs = ids.getIntId();
            if (offset + k > longIDs.getDataCount()) {
                throw new IllegalResponseException("Result ids count is wrong");
            }

            for (int n = 0; n < k; ++n) {
                idScore.add(new IDScore("", longIDs.getData((int)offset + n), results.getScores((int)offset + n)));
            }
        } else if (ids.hasStrId()) {
            StringArray strIDs = ids.getStrId();
            if (offset + k > strIDs.getDataCount()) {
                throw new IllegalResponseException("Result ids count is wrong");
            }

            for (int n = 0; n < k; ++n) {
                idScore.add(new IDScore(strIDs.getData((int)offset + n), 0, results.getScores((int)offset + n)));
            }
        } else {
            throw new IllegalResponseException("Result ids is illegal"); <-------- Exception originates here
        }

        return idScore;
    }

from milvus-sdk-java.

yhmo avatar yhmo commented on September 22, 2024

Refer to the example:

List<SearchResultsWrapper.IDScore> scores = wrapper.getIDScore(i);

from milvus-sdk-java.

yhmo avatar yhmo commented on September 22, 2024

The exception "Result ids is illegal" is usually thrown when user performs a search to an empty collection.
I have made a change to remove the exception, it will return an empty list instead of exception.

The original code:

      } else {
           throw new IllegalResponseException("Result ids is illegal"); 
       }

After the change:

        } else {
            return idScores;
        }

This change will be available in sdk version v2.3.3/v2.2.15, close this issue as well.

from milvus-sdk-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.