0
  1. How to fetch Foo.id alone for multiple documents in an index
  2. How to fetch Foo.bi for multiple documents in an index

Sample response from Spring Data Elasticsearch for Page is given below

"content": [ { "id": "MMb-sHUBU93O1WjGd0M1", "pid": "12500000", "bi": { "bar": 27, "height": { "feet": 5, "inches": 6, }, }, ]

1 Answer 1

1

As to retrieving partial attributes, use _source:

GET /_search
{
  "_source": {
    "includes": [
      "Foo.id",
      "Foo.bi"
    ],
    "excludes": []
  }
}

Regarding

How to query just partial attributes

you're sending a query againt the whole index in ES and the query parameter enables you to filter concrete fields so it does not really make sense to talk about querying partial attributes -- that's what the query already does.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.