Adding fields to a filter context

Hello,

I'm working on a filter query to speed up some searches but I only want to return certain fields. I've been running into some issues adding the fields I want to display to my query. This is what I have working:

{
  "query": {
    "bool": {
      "must":{ 
        "match": {
             "user.id": "producer"
        }
      },
            "filter": [
        { "term":  { "project": "closed" }}
      ]
    }
  }
  }

There are a number of fields in the document and I only want to return fields: project.name, 'cost.initial, cost.adjusted cost.total`

Thanks

Just bumping for visibility

See filter_path functionality: Common options | Elasticsearch Guide [7.13] | Elastic

Hello,

Thank you!

Hello,

I realize that isn't going to work. I'm trying to build this query as a saved search for a more performant vizualization.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.