Skip to content

chenhuang511/noob-search-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

noob-search-sample

This is sample app that demonstrate how elasticsearch is used for searching like Google.

ElasticStack Setup

Dataset

Index mapping

PUT wiki
{
  "settings" : {
    "analysis" : {
      "filter" : {
        "ascii_filter" : {
          "type" : "asciifolding",
          "preserve_original" : "true"
        },
        "ngram_filter" : {
          "type" : "edge_ngram",
          "min_gram" : "1",
          "max_gram" : "10"
        }
      },
      "analyzer" : {
        "vi_analyzer" : {
          "filter" : [
            "lowercase",
            "ascii_filter",
            "ngram_filter"
          ],
          "type" : "custom",
          "tokenizer" : "vi_tokenizer"
        }
      }
    }
  },
  "mappings": {
    "properties" : {
        "desc" : {
          "type" : "text"
        },
        "summary" : {
          "type" : "text"
        },
        "title" : {
          "type" : "text",
          "fields" : {
            "ngram" : {
              "type" : "text",
              "analyzer" : "vi_analyzer"
            }
          }
        }
      }
  }
}

NoobSearch webapp sample setup

  • Change elasticsearch host in server/index.js
  • Run: npm i
  • Run: node server/index.js

About

Sample for Elasticsearch learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published