ebook img

Elasticsearch in Action PDF

498 Pages·2015·15.01 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Elasticsearch in Action

Radu Gheorghe Matthew Lee Hinman Roy Russo M A N N I N G www.it-ebooks.info Elasticsearch in Action Licensed to Thomwaws wS.nite-eabdo <[email protected]> Licensed to Thomwaws wS.nite-eabdo <[email protected]> Elasticsearch in Action RADU GHEORGHE MATTHEW LEE HINMAN ROY RUSSO MANNING SHELTER ISLAND Licensed to Thomwaws wS.nite-eabdo <[email protected]> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 761 Shelter Island, NY 11964 Email: [email protected] ©2016 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine. Manning Publications Co. Development editor: Susan Conant 20 Baldwin Road Technical development editor: David Pombal PO Box 761 Copyeditor: Linda Recktenwald Shelter Island, NY 11964 Proofreader: Melody Dolab Technical proofreader: Valentin Crettaz Typesetter: Dennis Dalinnik Cover designer: Marija Tudor ISBN: 9781617291623 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – EBM – 20 19 18 17 16 15 Licensed to Thomwaws wS.nite-eabdo <[email protected]> brief contents PART 1 .......................................................................................1 1 ■ Introducing Elasticsearch 3 2 ■ Diving into the functionality 20 3 ■ Indexing, updating, and deleting data 53 4 ■ Searching your data 83 5 ■ Analyzing your data 118 6 ■ Searching with relevancy 148 7 ■ Exploring your data with aggregations 179 8 ■ Relations among documents 215 PART 2 ...................................................................................259 9 ■ Scaling out 261 10 ■ Improving performance 293 11 ■ Administering your cluster 340 v Licensed to Thomwaws wS.nite-eabdo <[email protected]> Licensed to Thomwaws wS.nite-eabdo <[email protected]> contents preface xv acknowledgments xvii about this book xix about the cover illustration xxiii PART 1 ........................................................................ 1 1 Introducing Elasticsearch 3 1.1 Solving search problems with Elasticsearch 4 Providing quick searches 5 ■ Ensuring relevant results 6 Searching beyond exact matches 7 1.2 Exploring typical Elasticsearch use cases 8 Using Elasticsearch as the primary back end 9 Adding Elasticsearch to an existing system 9 Using Elasticsearch with existing tools 11 Main Elasticsearch features 12 ■ Extending Lucene functionality 13 ■ Structuring your data in Elasticsearch 15 Installing Java 15 ■ Downloading and starting Elasticsearch 16 ■ Verifying that it works 16 1.3 Summary 18 vii Licensed to Thomwaws wS.nite-eabdo <[email protected]> viii CONTENTS 2 Diving into the functionality 20 2.1 Understanding the logical layout: documents, types, and indices 22 Documents 23 ■ Types 24 ■ Indices 25 2.2 Understanding the physical layout: nodes and shards 25 Creating a cluster of one or more nodes 26 ■ Understanding primary and replica shards 27 ■ Distributing shards in a cluster 30 ■ Distributed indexing and searching 31 2.3 Indexing new data 32 Indexing a document with cURL 32 ■ Creating an index and mapping type 35 ■ Indexing documents from the code samples 36 2.4 Searching for and retrieving data 37 Where to search 38 ■ Contents of the reply 39 How to search 42 ■ Getting documents by ID 45 2.5 Configuring Elasticsearch 46 Specifying a cluster name in elasticsearch.yml 46 Specifying verbose logging via logging.yml 47 Adjusting JVM settings 47 2.6 Adding nodes to the cluster 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 documents 54 Retrieving and defining mappings 56 ■ Extending an existing mapping 57 3.2 Core types for defining your own fields in documents 58 String 59 ■ Numeric 61 ■ Date 62 ■ Boolean 63 3.3 Arrays and multi-fields 63 Arrays 64 ■ Multi-fields 64 3.4 Using predefined fields 65 Controlling how to store and search your documents 66 Identifying your documents 68 3.5 Updating existing documents 70 Using the update API 72 ■ Implementing concurrency control through versioning 74 Licensed to Thomwaws wS.nite-eabdo <[email protected]> CONTENTS ix 3.6 Deleting data 78 Deleting documents 78 ■ Deleting indices 80 Closing indices 81 ■ Re-indexing sample documents 81 3.7 Summary 82 4 Searching your data 83 4.1 Structure of a search request 84 Specifying a search scope 85 ■ Basic components of a search request 86 ■ Request body–based search request 88 Understanding the structure of a response 91 4.2 Introducing the query and filter DSL 92 Match query and term filter 92 ■ Most used basic queries and filters 95 ■ Match query and term filter 102 Phrase_prefix query 103 4.3 Combining queries or compound queries 105 bool query 105 ■ bool filter 107 4.4 Beyond match and filter queries 109 Range query and filter 109 ■ Prefix query and filter 111 Wildcard query 112 4.5 Querying for field existence with filters 113 Exists filter 114 ■ Missing filter 114 ■ Transforming any query into a filter 115 4.6 Choosing the best query for the job 116 4.7 Summary 117 5 Analyzing your data 118 5.1 What is analysis? 119 Character filtering 120 ■ Breaking into tokens 120 Token filtering 120 ■ Token indexing 120 5.2 Using analyzers for your documents 121 Adding analyzers when an index is created 122 Adding analyzers to the Elasticsearch configuration 123 Specifying the analyzer for a field in the mapping 124 5.3 Analyzing text with the analyze API 126 Selecting an analyzer 127 ■ Combining parts to create an impromptu analyzer 127 ■ Analyzing based on a field’s mapping 128 ■ Learning about indexed terms using the terms vectors API 128 Licensed to Thomwaws wS.nite-eabdo <[email protected]>

Description:
Adding analyzers to the Elasticsearch configuration 123. Specifying the 7.1 Understanding the anatomy of an aggregation 182. Structure of an
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.