Share E-Book
Scan to open this page

Scan with your phone to open this page

AuthorRadu Gheorghe, Matthew Lee Hinman, Roy Russo

Modern search seems like magic—you type a few words and the search engine appears to know what you want. With the Elasticsearch real-time search and analytics engine, you can give your users this magical experience without having to do complex low-level programming or understand advanced data science algorithms. You just install it, tweak it, and get on with your work. Elasticsearch in Action teaches you how to write applications that deliver professional quality search. As you read, you'll learn to add basic search features to any application, enhance search results with predictive analysis and relevancy ranking, and use saved data from prior searches to give users a custom experience. This practical book focuses on Elasticsearch's REST API via HTTP. Code snippets are written mostly in bash using cURL, so they're easily translatable to other languages.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide to building professional-quality search into your applications with Elasticsearch, using its REST API and cURL examples that translate to any language. Best for developers who want working search features—indexing, querying, relevance tuning, and suggestions—without wrestling low-level Lucene internals. 【Book Arc】 - **Opening (~0%–10%)**: Introduces Elasticsearch as a distributed, Lucene-based search engine, its typical use cases (full-text search plus real-time analytics), and how to install and reach it via the REST API on port 9200. - **Early (~10%–32%)**: Covers the logical and physical layout—documents, types, indices, nodes, and primary/replica shards—then walks through indexing your first document, auto-creating indices and mappings, and retrieving data. - **Early–Middle (~32%–48%)**: Moves into mappings and core field types (string, numeric, date, boolean), arrays and multi-fields, predefined fields, updating documents, and optimistic concurrency control through versioning. - **Middle (~39%–48%)**: Explains the anatomy of a search request—query, size, from, _source, and sort—and the crucial query-versus-filter distinction, including the filtered query and cacheable bitsets. - **Middle (~48%+)**: Dives into query types such as match (boolean and phrase behavior with slop) and range, with guidance to prefer filters for performance. - **Late (beyond excerpts)**: The excerpts do not cover the later chapters on analysis, performance, and administration in detail; the table of contents hints at these but the sampled material stops around query construction. 【Key Takeaways】 - **Elasticsearch is document-oriented and schema-free by default** (Early): You can index a document without pre-creating the index or mapping—Elasticsearch auto-generates both, letting you start fast and refine later. - **The logical/physical split matters** (Early): Documents live in types within indices (logical), while nodes and primary/replica shards handle storage and distribution (physical); understanding this explains how indexing and searching scale. - **Queries score, filters don't** (Middle): Queries return relevance scores; filters only ask whether a document matches, making them faster and cacheable. The book's rule of thumb: if unsure, make it a filter. - **Mappings control searchability** (Early–Middle): The `index` option (`analyzed`, `not_analyzed`, `no`) determines whether and how a field is searchable—critical for matching user expectations. - **Versioning enables optimistic concurrency** (Early–Middle): Each update increments a version; conflicting parallel updates fail, and `retry_on_conflict` can reapply automatically. - **Search requests have tunable components** (Middle): `size`, `from`, `_source`, and `sort` shape results; deep pagination is expensive because Elasticsearch must compute all preceding top hits. - **Match queries are flexible** (Middle): Default boolean/OR behavior can be switched to AND, or to phrase behavior with slop for positional matching. - **REST API via cURL is the teaching vehicle** (throughout): Examples are language-agnostic, so you can port them to your stack. 【Reading Tips】 - Deep-read the early chapters on documents, types, indices, and shards—these mental models underpin everything later. - Skim the installation and configuration material if you already have a running cluster; return to it when tuning cluster name or JVM settings. - Pay close attention to the query-versus-filter distinction and the filtered query pattern; it recurs and affects performance. - Treat the cURL snippets as templates: run them, then translate to your language's HTTP client. - Don't skip the versioning/concurrency section if your application performs concurrent updates. 【Coverage Limits】 This guide is based on stratified excerpts covering roughly the first half of the book; later chapters on analysis, performance tuning, and administration are only hinted at and not summarized here.
Page 9
48 Starting a second node 50 ■ Adding additional nodes 51 2.7 Summary 52 3 Indexing, updating, and deleting data 53 3.1 Using mappings to define kinds of doc...
View in text
Excerpt 2
hards, regardless of their status as primaries or replicas. located on a different node, like it is on Node 2 in figure 2.4, but this is transparent to the a...
View in text
Excerpt 3
Elasticsearch to generate unique IDs for you. This is use- ful if you don’t already have a unique ID or you don’t need to identify documents by a certain pro...
View in text
Excerpt 4
this filter. Figure 4.3 shows what this bitset looks like. After constructing the bitset, Elasticsearch can now use it to filter (hence the name!) out the do...
View in text
Excerpt 5
ail.com> 136 CHAPTER 5 Analyzing your data } } } } Now you have the index with the configured custom filter called my-length-filter. In the next request you...
View in text
Excerpt 6
h a phrase query with a high slop value can be expensive to run, you don’t have to worry, because the query will run on only the top 20 documents instead of...
View in text
Excerpt 7
th URI=localhost:9200/get-together/event/_search curl "$URI?pretty&search_type=count" -d '{ "aggregations": { "event_dates": { "date_histogram": { interval h...
View in text
Excerpt 8
de_in_parent": true, also indexed as objects for the "properties": { parent members documents. "date": { "type": "date", "format": "dateOptionalTime" "commen...
View in text
Tags
AI categories
ProgrammingDataBackend
ISBN: 1617291625
Publish Year: 2015
Language: English
Pages: 496
File Format: PDF
File Size: 15.0 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…