Skip to content

Instantly share code, notes, and snippets.

@Atinux
Forked from alexbrasetvik/analysis.yaml
Created November 21, 2013 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Atinux/7583823 to your computer and use it in GitHub Desktop.
Save Atinux/7583823 to your computer and use it in GitHub Desktop.
Standard tokenization, but without the lowercasing and stopword removal.
text: Je suis une petite hirondelle qui adore sautiller dans l'herbe chanté bébé à l'@email !
analyzer:
standard:
type: standard
simple:
type: simple
stop:
type: stop
snowball:
type: snowball
french:
type: french
special:
type: custom
tokenizer: standard
filter:
- lowercase
- asciifolding
- phonetic
username: Atinux
# GO to Analysis tab :)
# GO to Analysis tab :)
#!/bin/bash
export ELASTICSEARCH_ENDPOINT="http://localhost:9200"
# Create indexes
curl -XPUT "$ELASTICSEARCH_ENDPOINT/play" -d '{
"settings": {
"analysis": {
"text": "Je suis une petite hirondelle qui adore sautiller dans l'herbe chanté bébé à l'@email !",
"analyzer": {
"standard": {
"type": "standard"
},
"simple": {
"type": "simple"
},
"stop": {
"type": "stop"
},
"snowball": {
"type": "snowball"
},
"french": {
"type": "french"
},
"special": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"asciifolding",
"phonetic"
]
}
}
}
},
"mappings": {}
}'
# Index documents
curl -XPOST "$ELASTICSEARCH_ENDPOINT/_bulk?refresh=true" -d '
{"index":{"_index":"play","_type":"type"}}
{"username":"Atinux"}
'
# Do searches
curl -XPOST "$ELASTICSEARCH_ENDPOINT/_search?pretty" -d '
{
"query": {
"match_all": {}
}
}
'
# Auto generated by Found's Play-tool at 2013-11-21T16:39:56+01:00
version: 0
title: Examples of analyzer/tokenizer
description: Multiples analyzer and one custom with tokenizer and filter to show the differences.
# GO to Analysis tab :)
query:
match_all: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment