Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- url -XPUT 'localhost:9200/pet_index?pretty' -H 'Content-Type: application/json' -d'
- { "mappings": {
- "pet_owner": {
- "properties": {
- "name": { "type": "text" },
- "age": { "type": "integer" },
- "pet": { "type": "text" },
- "created": {
- "type": "date",
- "format": "strict_date_optional_time||epoch_millis"
- }
- }
- }
- },
- "settings": {
- "index" : {
- "analysis" : {
- "analyzer" : {
- "search_synonyms" : {
- "tokenizer" : "whitespace",
- "filter" : ["graph_synonyms"]
- }
- },
- "filter" : {
- "graph_synonyms" : {
- "type" : "synonym_graph",
- "synonyms_path" : "analysis/synonym2.txt"
- }
- }
- }
- }
- }
- }
- '
- curl -XGET 'localhost:9200/pet_index/_search?pretty' -H 'Content-Type: application/json' -d'
- {
- "query" : {
- "match" : {
- "pet" : {
- "query":"pet",
- "analyzer": "search_synonyms"
- }
- }
- }
- }
- '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement