Skip to content

Instantly share code, notes, and snippets.

@skakri
Created April 22, 2014 13:30
Show Gist options
  • Save skakri/11179326 to your computer and use it in GitHub Desktop.
Save skakri/11179326 to your computer and use it in GitHub Desktop.
// Comments and commas for syntax
highlighting = [
//POST test
{
"settings": {
"analysis": {
"filter": {
"synonym": {
"synonyms_path": "/usr/share/wordnet-prolog/wn_s.pl",
"ignore_case": "true",
"type": "synonym",
"format": "wordnet"
}
},
"analyzer": {
"synonym_analyzer": {
"char_filter": "html_strip",
"filter": [
"asciifolding",
"snowball",
"synonym"
],
"type": "custom",
"tokenizer": "lowercase"
}
}
}
},
"mappings": {
"child": {
"_parent": {
"type": "parent"
}
}
}
}
,
//PUT test/parent/1
{
"type": "flying stuff"
}
,
//PUT test/child/1?parent=1
{
"name": "butterfly"
}
,
//PUT test/child/2?parent=1
{
"name": "<strong>tire</strong>"
}
,
//GET test/parent/_search
{
"query": {
"has_child": {
"type": "child",
"query": {
"match": {
"name": {
"query": "strong",
"analyzer": "synonym_analyzer"
}
}
}
}
}
}
,
//GET test/child/_search
{
"query": {
"match": {
"name": {
"query": "strong",
"analyzer": "synonym_analyzer"
}
}
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment