Created
August 5, 2015 17:01
-
-
Save nik9000/d420c02f625a956e0faf 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 0:9200/test?pretty | |
curl -XPUT 0:9200/test?pretty -d'{ | |
"mappings" : { | |
"test": { | |
"properties": { | |
"content" : { | |
"type" : "string", | |
"analyzer" : "french" | |
} | |
} | |
} | |
} | |
}' | |
if [ ! -e doc.json ]; then | |
curl https://gist.githubusercontent.com/scharron/684a4fbab85135c203ee/raw/ef3c13b1cbebbec9f5c7841983f12d48379129b9/doc.json > doc.json | |
fi | |
curl -XPUT '0:9200/test/test/0?pretty&refresh' -d@doc.json | |
curl -XPOST '0:9200/test/_search?pretty' -d'{ | |
"query": { | |
"filtered": { | |
"query": { | |
"query_string": { | |
"query": "\"Vlaams Brabant\"", | |
"fields": [ | |
"content" | |
] | |
} | |
} | |
} | |
}, | |
"highlight": { | |
"fragment_size": 100, | |
"fields": { | |
"content": {} | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment