Created
July 8, 2012 16:18
-
-
Save imotov/3071582 to your computer and use it in GitHub Desktop.
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
curl -XDELETE 'http://localhost:9200/windowz' | |
echo | |
curl -XPUT 'http://localhost:9200/windowz' -d '{ | |
"mappings" : { | |
"message" : { | |
"properties" : { | |
"title" : { | |
"type" : "string", | |
"search_analyzer" : "str_search_analyzer", | |
"index_analyzer" : "str_index_analyzer" | |
} | |
} | |
} | |
}, | |
"settings" : { | |
"analysis" : { | |
"analyzer" : { | |
"str_search_analyzer" : { | |
"tokenizer" : "standard", | |
"filter" : ["lowercase","custom_stop"] | |
}, | |
"str_index_analyzer" : { | |
"tokenizer" : "standard", | |
"filter" : ["lowercase", "custom_stop"] | |
} | |
}, | |
"filter" : { | |
"custom_stop": { | |
"type": "stop", | |
"stopwords": ["a", "an", "and", "are", "as", "at", "be", "but", "by", "into", "is", "it", "of", "on", "or", "such", "that", "the", "their", "there", "these", "they", "this", "to", "was", "will","we"] | |
} | |
} | |
} | |
} | |
}' | |
echo | |
curl -XGET 'http://localhost:9200/windowz/_analyze?analyzer=str_index_analyzer&pretty=true' -d 'Alice looked all round the table, but there was nothing on it but tea.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment