Search code examples
elasticsearchnest

Source filtering while searching inside multiple indices using Nest ElasticSearch


I followed the instructions to search multiple indices using NEST ElasticSearch mentioned here.

How to search inside multiple indices using Nest ElasticSearch?

Now I want to select only certain fields per index from the matching results (hits). Is that something that can be built into the query within C# itself ?


Solution

  • Source filtering applies to the _source of all hits from all indices; it's not possible to target the _source of hits from specific indices within the body of a single search request.