-
Notifications
You must be signed in to change notification settings - Fork 0
Elasticsearch
illyfrancis edited this page Sep 22, 2015
·
4 revisions
- searching pieces of pure text
- searching text + structured data (products, user profiles, application logs)
- pure aggregated data (stats, metrics, etc)
- geo search
- distributed JSON document DB (anything) - not really a use case
- is a database, like other
- document oriented
- clusters
- built on Lucene
- build on an IR foundation (information retrieval)
- can perform fancy tricks with inverted indexes and automata (???)
storing a document
verb: PUT
index: literature
type: quote
docId: one
document: {json}
curl -XPUT http://localhost:9200/literature/quote/one -d'
{
"person": "Jack Handy",
"said": "The face of a child can say it all, especially the mouth part of the face"
}'
indexes live in the cluster, documents live in indexes
- a single arbitrary JSON object
- stored as a text blob + indexes on fields
- all fields get an inverted index(es)
- defines the schema for documents
- defines indexing rules as well
{
"human" : {
"properties" : {
"person" : { "type": "string" },
"age" : { "type" : "integer" } }}}
- largest building block in ES
- container for documents / types
- composable
11:36
Document, routing, Shards
A simple query
verb: POST
index: literature
type: quote
action: _search
search body: {json}
curl -XPOST http://localhost:9200/literature/quote/_search -d'
{
"query": {
"match": {
"person": "jack" }}}'