GithubHelp home page GithubHelp logo

Comments (7)

alexklibisz avatar alexklibisz commented on August 26, 2024

I don't see anything obviously wrong with the query.
The error indicates that JSON parsing fails at some point.
Can you post more of the stacktrace so I know at what stage in the query lifecycle this error is happening?

from elastiknn.

techhero-es avatar techhero-es commented on August 26, 2024

The full error message is
{ "error": { "root_cause": [ { "type": "", "reason": "Unexpected field: [field]; valid fields: : DownField(vec)" } ], "type": "", "reason": "Unexpected field: [field]; valid fields: : DownField(vec)" }, "status": 500 }

and the log just says
[2020-10-30T16:49:05,035][WARN ][r.suppressed ] [Matthiass-MacBook-Pro.local] path: /my-index/_search, params: {index=my-index} io.circe.DecodingFailure$$anon$2: Unexpected field: [field]; valid fields: : DownField(vec)

I am using elastiknn 0.1.0-PRE43_es7.6.2. I hope this helps. Is there a way to get a full stacktrace?

from elastiknn.

alexklibisz avatar alexklibisz commented on August 26, 2024

Usually there are more messages surrounding the log warning. But it might depend on how you have Elasticsearch configured. I think the full error message and log error above are different errors. One says Unexpected field: [id] and the other says Unexpected field: [field].

In any case, I'm curious about a couple things:

  • How are you submitting the queries? Python client? Bash/curl?
  • Does the indexed-vector query work if you reference vectors from another index?

from elastiknn.

techhero-es avatar techhero-es commented on August 26, 2024

Upps, sorry. I was trying to remove fields from the query to see what happens and forgot to revert to my original query. I amended the error message in the comment above to match the query and log message.

I am using curl like this
curl -XPOST 'localhost:9200/my-index/_search' -H 'Content-Type: application/json' -d @querybyid.json
querybyid.json contains the query from above.

I created another index and referenced the query vector from there
{ "query": { "elastiknn_nearest_neighbors": { "field": "my_vec", "vec": { "index": "my-index-2", "field": "my_vec", "id": 1 }, "model": "exact", "similarity": "l1" } } }
This gives me the same error.

Thank you for your time.

from elastiknn.

alexklibisz avatar alexklibisz commented on August 26, 2024

I think this might be more of a CURL and/or http issue.

This might work:

First, use "id": "1", since the id is a string.

Then, use --data-binary instead of -d.

curl -XPOST 'localhost:9200/my-index/_search' -H 'Content-Type: application/json' --data-binary @querybyid.json

See here for --data-binary reasoning.

from elastiknn.

techhero-es avatar techhero-es commented on August 26, 2024

It works! Specifying the id as a string did the trick.

Thank you!

from elastiknn.

alexklibisz avatar alexklibisz commented on August 26, 2024

Great. I'll try to make that more clear in the docs or at least improve the error message.

from elastiknn.

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.