docs

a slatepencil documentail site

View on GitHub

elasticsearch

ELK stack setup

INDEX APIS

# Create Index
PUT /{index_name}/
# close index
POST /{index_name}/_close
# update index setting
PUT /{index_name}/_settings
{
  max_ngram_diff: "50",
  analysis: {
    filter: {
      autocomplete_filter: {
        type: "ngram",
        min_gram: "1",
        max_gram: "20",
      },
    },
    analyzer: {
      autocomplete: {
        filter: ["lowercase", "autocomplete_filter"],
        type: "custom",
        tokenizer: "whitespace",
      },
    },
  },
  number_of_replicas: "1",
}
# open index
POST /{index_name}/_open

# Update Mappings
PUT /{index_name}/_mappings
{
  properties: {
    id: { type: "text" },
    make: {
      type: "text",
      analyzer: "autocomplete",
      search_analyzer: "standard",
    },
    model: {
      type: "text",
      analyzer: "autocomplete",
      search_analyzer: "standard",
    },
    type: { type: "keyword" },
  },
}
# Get Index Properties
GET /{index_name}/
# Delete index
DELETE /{index_name}
# List all Indices
GET /_cat/indices?v
# get document
GET /{index_name}/_doc/{docId}

Mapping & Analyzer

Query

scripts