Source filtering in Elasticsearch queries
📖 Scenario: You work with a collection of books stored in Elasticsearch. Each book has details like title, author, year, and summary. Sometimes you want to get only specific fields from the search results to save bandwidth and focus on what matters.
🎯 Goal: Build an Elasticsearch query that searches for books by author and uses source filtering to return only the title and year fields in the results.
📋 What You'll Learn
Create a query that searches for books where the
author is exactly 'Jane Austen'.Add source filtering to include only the
title and year fields in the search results.Use the Elasticsearch JSON query format.
💡 Why This Matters
🌍 Real World
Source filtering helps reduce the amount of data sent over the network by returning only the fields you need from Elasticsearch search results.
💼 Career
Many jobs working with Elasticsearch require efficient queries that return only relevant data to improve performance and reduce costs.
Progress0 / 4 steps