Created
November 14, 2013 10:29
Revisions
-
alexbrasetvik revised this gist
Nov 14, 2013 . No changes.There are no files selected for viewing
-
alexbrasetvik revised this gist
Nov 14, 2013 . 3 changed files with 9 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,3 +4,8 @@ analyzer: standard_tokenize_only: type: custom tokenizer: standard # Switch to the "Analysis"-tab to see how the text gets tokenized by default. standard: type: standard This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,9 @@ curl -XPUT "$ELASTICSEARCH_ENDPOINT/play" -d '{ "standard_tokenize_only": { "type": "custom", "tokenizer": "standard" }, "standard": { "type": "standard" } } } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Auto generated by Found's Play-tool at 2013-11-14T11:31:15+01:00 version: 0 title: Simple case sensitive search description: "Standard tokenization, but without the lowercasing and stopword removal." -
alexbrasetvik created this gist
Nov 14, 2013 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ text: This text will be used if nothing else is specified. analyzer: standard_tokenize_only: type: custom tokenizer: standard This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ title: Foo Bar --- title: foo bar This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ type: properties: title: type: string analyzer: standard_tokenize_only This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,65 @@ #!/bin/bash export ELASTICSEARCH_ENDPOINT="http://localhost:9200" # Create indexes curl -XPUT "$ELASTICSEARCH_ENDPOINT/play" -d '{ "settings": { "analysis": { "text": "This text will be used if nothing else is specified.", "analyzer": { "standard_tokenize_only": { "type": "custom", "tokenizer": "standard" } } } }, "mappings": { "type": { "properties": { "title": { "type": "string", "analyzer": "standard_tokenize_only" } } } } }' # Index documents curl -XPOST "$ELASTICSEARCH_ENDPOINT/_bulk?refresh=true" -d ' {"index":{"_index":"play","_type":"type"}} {"title":"Foo Bar"} {"index":{"_index":"play","_type":"type"}} {"title":"foo bar"} ' # Do searches curl -XPOST "$ELASTICSEARCH_ENDPOINT/_search?pretty" -d ' { "query": { "match": { "title": { "query": "Foo" } } } } ' curl -XPOST "$ELASTICSEARCH_ENDPOINT/_search?pretty" -d ' { "query": { "match": { "title": { "query": "foo" } } } } ' This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ # Auto generated by Found's Play-tool at 2013-11-14T11:29:41+01:00 version: 0 title: Simple case sensitive search description: "Standard tokenization, but without the lowercasing and stopword removal." This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ query: match: title: # This will only match the first document. query: Foo --- query: match: title: # This will match the second document only query: foo