Skip to content

Commit

Permalink
Finished 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed Oct 18, 2014
1 parent 9a776d6 commit 308d873
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 471 deletions.
57 changes: 0 additions & 57 deletions 050_Search/00_Intro.asciidoc

This file was deleted.

60 changes: 18 additions & 42 deletions 050_Search/00_Intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,35 @@
== Searching – the basic tools
## 搜索——基本的工具

So far, we have learned how to use Elasticsearch as a simple NoSQL-style
distributed document store -- we can throw JSON documents at Elasticsearch and
retrieve each one by ID. But the real power of Elasticsearch lies in its
ability to make sense out of chaos -- to turn Big Data into Big Information.
到目前为止,我们已经学会了如何使用elasticsearch作为一个简单的NoSQL风格的分布式文件存储器——我们可以将一个JSON文档扔给Elasticsearch,也可以根据ID检索它们。但Elasticsearch真正强大之处在于可以从混乱的数据中找出有意义的信息——从大数据到全面的信息。

至目前,我们已经学会了如何使用elasticsearch作为一个简单的NoSQL风格的分布式文件存储器——我们可以将一个JSON文档扔给Elasticsearch,也可以根据ID检索它们
这也是为什么我们使用结构化的JSON文档,而不是无结构的二进制数据。Elasticsearch不只会**存储(store)**文档,也会**索引(indexes)**文档内容来使之可以被搜索

This is the reason that we use structured JSON documents, rather than
amorphous blobs of data. Elasticsearch doesn't only _store_ the document, it
also _indexes_ the content of the document in order to make it searchable.

*Every field in a document is indexed and can be queried*. And it's not just
that. During a single query, Elasticsearch can use *all* of these indices, to
return results at breath-taking speed. That's something that you could never
consider doing with a traditional database.
**每个文档里的字段都会被索引并被查询**。而且不仅如此。在简单查询时,Elasticsearch可以使用**所有**的索引,以非常快的速度返回结果。这让你永远不必考虑传统数据库的一些东西。

A _search_ can be:
**搜索(search)**可以:

* a structured query on concrete fields like `gender` or `age`, sorted by
a field like `join_date`, similar to the type of query that you could construct
in SQL

* a full text query, which finds all documents matching the search keywords,
and returns them sorted by _relevance_

* or a combination of the two

While many searches will just work out of the box, to use Elasticsearch to
its full potential you need to understand three subjects:

[horizontal]
* 在类似于`gender`或者`age`这样的字段上使用结构化查询,`join_date`这样的字段上使用排序,就像SQL的结构化查询一样。
* 全文检索,可以使用所有字段来匹配关键字,然后按照**关联性(relevance)**排序返回结果。
* 或者结合以上两条。

_Mapping_:: how the data in each field is interpreted
_Analysis_:: how full text is processed to make it searchable
_Query DSL_:: the flexible, powerful query language used by Elasticsearch
很多搜索都是开箱即用的,为了充分挖掘Elasticsearch的潜力,你需要理解以下三个概念:

Each of the above is a big subject in its own right and we explain them in
detail in <<search-in-depth>>. The chapters in this section will introduce the
basic concepts of all three -- just enough to help you to get an overall
understanding of how search works.

We will start by explaining the `search` API in its simplest form.
| 概念 | 解释 |
| ------------------------------- | ----------------------------------------- |
| **映射(Mapping)** | 数据在每个字段中的解释说明 |
| **分析(Analysis)** | 全文是如何处理的可以被搜索的 |
| **领域特定语言查询(Query DSL)** | Elasticsearch使用的灵活的、强大的查询语言 |

.Test data

****
以上提到的每个点都是一个巨大的话题,我们将在《深入搜索》一章阐述它们。本章节我们将介绍这三点的一些基本概念——仅仅帮助你大致了解搜索是如何工作的。

The documents that we will use for test purposes in this chapter can be found
in this gist: https://gist.github.com/clintongormley/8579281
我们将使用最简单的形式开始介绍`search` API.

You can copy the commands and paste them into your shell in order to follow
along with this chapter.
> ### 测试数据
Alternatively, link:sense_widget.html?snippets/050_Search/Test_data.json[click here to open in Sense].
> 本章节测试用的数据可以在这里被找到[https://gist.github.com/clintongormley/8579281](https://gist.github.com/clintongormley/8579281)
****
> 你可以把这些命令复制到终端中执行以便可以实践本章的例子。
114 changes: 0 additions & 114 deletions 050_Search/05_Empty_search.asciidoc

This file was deleted.

61 changes: 0 additions & 61 deletions 050_Search/10_Multi_index_multi_type.asciidoc

This file was deleted.

53 changes: 0 additions & 53 deletions 050_Search/15_Pagination.asciidoc

This file was deleted.

Loading

0 comments on commit 308d873

Please sign in to comment.