Created
November 14, 2013 10:29
-
-
Save alexbrasetvik/7464654 to your computer and use it in GitHub Desktop.
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 characters
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 characters
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 characters
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 characters
#!/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 characters
# 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 characters
query: | |
match: | |
title: | |
# This will only match the first document. | |
query: Foo | |
--- | |
query: | |
match: | |
title: | |
# This will match the second document only | |
query: foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment