Elasticsearch Blueprints

Elasticsearch Blueprints

Language: English

Pages: 192

ISBN: 1783984929

Format: PDF / Kindle (mobi) / ePub

Elasticsearch Blueprints

Language: English

Pages: 192

ISBN: 1783984929

Format: PDF / Kindle (mobi) / ePub


A practical project-based guide to generating compelling search solutions using the dynamic and powerful features of Elasticsearch

About This Book

  • Discover the power of Elasticsearch by implementing it in a variety of real-world scenarios such as restaurant and e-commerce search
  • Discover how the features you see in an average Google search can be achieved using Elasticsearch
  • Learn how to not only generate accurate search results, but also improve the quality of searches for relevant results

Who This Book Is For

If you are a data enthusiast and would like to explore and specialize on search technologies based on Elasticsearch, this is the right book for you. A compelling case-to-case mapping of features and implementation of Elasticsearch to solve many real-world use cases makes this book the right choice to start and specialize on Elasticsearch.

What You Will Learn

  • Build a simple scalable server for effective searching in Elasticsearch
  • Design a scalable e-commerce search solution to generate accurate search results using various filters such as filters based on date range and price range
  • Improve the relevancy and scoring of your searches
  • Manage real-world, complex data using various techniques, including parent-child search and searching questions based on the criteria of questions and answers
  • Use the excellent data crunching and aggregation capability of Elasticsearch to analyze your data
  • Generate real-time visualizations of your data using compelling visualization techniques, such as time graphs, pie charts, and stacked graphs
  • Enhance the quality of your search and widen the scope of matches using various analyzer techniques, such as lower casing, stemming, and synonym matching

In Detail

Elasticsearch is a distributed search server similar to Apache Solr with a focus on large datasets, schemaless setup, and high availability. Utilizing the Apache Lucene library (also used in Apache Solr), Elasticsearch enables powerful full-text search, as well as autocomplete "morelikethis" search, multilingual functionality, and an extensive search query DSL.

This book starts with the creation of a Google-like web search service, enabling you to generate your own search results. You will then learn how an e-commerce website can be built using Elasticsearch. We will discuss various approaches in getting relevant content up the results, such as relevancy based on how well a query matched the text, time-based recent documents, geographically nearer items, and other frequently used approaches.

Finally, the book will cover various geocapabilities of Elasticsearch to make your searches similar to real-world scenarios.

TextMate: Power Editing for the Mac

JavaServer Faces in Action

Python Crash Course

Modern PHP: New Features and Good Practices

 

 

 

 

 

 

 

 

 

 

 

 

if [ -z $1 ] ; then echo "Please enter hostname" exit fi hostname=$1 curl -X PUT "http://$hostname:9200/planeticketing" -d '{ "index": { "number_of_shards": 2, "number_of_replicas": 1 } }' curl -X PUT "http://$hostname:9200/planeticketing/ticket/_mapping" -d '{ "ticket" : { "properties" : { "ticketType" : { "type" : "string" , "index" : "not_analyzed" }, "timeOfBooking" : { "type" : "date", "format" : "YYYY-MM-dd HH:mm:ss"}, "departure" : { "properties" : { "airport" : { "type" : "string" },

be qualified as a result Hence, both Document 1 and Document 2 matched our query rather than just Document 1. The solution for this problem is to use the UAX Email URL tokenizer rather than the default tokenizer. This tokenizer preserves e-mail IDs and URL links and won't break them. Hence our search works. Let's see how we can make the analyzer for this: curl -X PUT "http://localost:9200/news" -d '{ "analysis": { "analyzer": { "urlAnalyzer": { "type": "custom", "tokenizer":

we received the results as follows: { "took": 44, "timed_out": false, "_shards": { "total": 1, "successful": 1, "failed": 0 }, "hits": { "total": 5, "max_score": 0, "hits": [ ] }, "aggregations": { "distanceRanges": { "buckets": [ { "key": "Near by Locations", "from": 0, "to": 200, "doc_count": 1 }, { "key": "Medium distance Locations", "from": 200, "to": 2000, "doc_count": 0 }, { "key": "Far Away Locations", "from": 2000, "doc_count": 4 } ] } } } In the results, we received how many

better performance results. There are three stages through which you can perform an analysis: Character filters: Filtering is done at character level before processing for tokens. A typical example of this is an HTML character filter. We might give an HTML to be indexed to Elasticsearch. In such instances, we can provide the HTML CHAR filter to do the work. Tokenizers: The logic to break down text into tokens is depicted in this state. A typical example of this is whitespace tokenizers. Here,

each stage. A combination of these components is called an analyzer. To create an analyzer out of the existing components, all we need to do is add the configuration to our Elasticsearch configuration file. Types of character filters The following are the different types of character filters: HTML stripper: This strips the HTML tags out of the text. Mapping char filter: Here, you can ask Elasticsearch to convert a set of characters or strings to another set of characters or strings.

Download sample

Download