This repo provides the instructions and examples from the demo highlighting the features of elasticsearch.
Launch an elasticsearch service instance on elastic cloud
Using Docker, you can get up and running using the stack docker-compose file on github .
git clone https://github.com/elastic/stack-docker.git
docker-compose -f setup.yml up
docker-compose up -d elasticsearch kibana
GET /_analyze
{
"analyzer": "english",
"text": "I will either find a way or make one."
}
GET /_analyze
{
"char_filter": [
"html_strip"
],
"tokenizer": "standard",
"filter": [
"lowercase",
"stop"
],
"text": "I will either find a <em>way</em> or make one."
}
GET /_analyze
{
"analyzer": "french",
"text": "Je trouverai un chemin, ou j’en créerai un."
}
PUT /hannibal
{
"settings": {
"analysis": {
"filter": {
"my_synonym_filter": {
"type": "synonym",
"synonyms": [
"make,create"
]
}
},
"analyzer": {
"my_analyzer" : {
"char_filter": [
"html_strip"
],
"tokenizer": "standard",
"filter": [
"lowercase",
"stop",
"my_synonym_filter"
]
}
}
}
},
"mappings": {
"_doc": {
"properties": {
"quote": {
"type": "text",
"analyzer": "my_analyzer"
}
}
}
}
}
PUT /hannibal/_doc/1
{
"quote": "I will either find a <em>way</em> or make one."
}
PUT /hannibal/_doc/2
{
"quote": "I have come not to make war on the Italians, but to aid the Italians against Rome."
}
PUT /hannibal/_doc/3
{
"quote": "God has given to man no sharper spur to victory than contempt of death."
}
POST /hannibal/_search
{
"query": {
"match_all": { }
}
}
POST /hannibal/_search
{
"query": {
"match": {
"quote": "make"
}
}
}
POST /hannibal/_search
{
"query": {
"match": {
"quote": "create"
}
}
}
POST /hannibal/_search?explain=true
{
"query": {
"match": {
"quote": "make"
}
}
}