Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

The Default Password For The User Is .: Elastic Changeme

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

ElasticSearch: download in from site (http://localhost:9200)

Kibana: download it from site (http://localhost:5601/)

Note: set the jvn heap size inside etc/jvm.options

a) Install x-pack : (https://www.elastic.co/downloads/x-pack)

Cd bin

Elasticsearch-plugin install x-pack

After installation if getting error:


xpack.ml.enabled: false in elasticsearch.yml file

The default password for the elastic user is changeme.

b) Once kibana is loaded ,click on the dev toll and start creating index ,type,docs and shards
c) We can use CRUD API (GET,PUT,POST,DELETE)

THERE ARE SOME EXAMPLES:


POST /my-index/my-type/1
{
"body":"foo"
}
GET /my-index/my-type/1

PUT /company/employee/1
{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"analysis": {
"analyzer": {
"analyzer-name": {
"type": "custom",
"tokenizer": "keyword",
"filter": "lowercase"
}
}
},
"mappings": {
"employee": {
"properties": {
"age": {
"type": "long"
},
"experience": {
"type": "long"
},
"name": {
"type": "string",
"analyzer": "analyzer-name"
}
}
}
}
}
}
POST company/employee/_create
{
"name": "Andrew",
"age" : 45,
"experience" : 10
}
GET company/employee/_search
{
"query": {
"match_all": {}
}
}
GET company/employee/_search
{
"query": {
"match": {
"name": "Andrew"
}
}
}

GET company/employee/_search
{
"query": {
"range": {
"age": { "gte": 35 }
}
}
}

GET company/employee/_search
{
"bool": {
"must": { "match": {"name": "Andrew" }},
"should": { "range": {"age": { "gte": 35 }}}
}
}

You might also like