-
-
Save nkvoll/9f003179c02ebe9b69ae 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/test?pretty | |
curl -XPOST http://localhost:9200/test/my_type/1?pretty -d ' | |
{ | |
"foo": { | |
"bar": "this is bar" | |
} | |
}' | |
# give es some time: | |
sleep 1 | |
# works as expected: | |
curl http://localhost:9200/test/_search?pretty -XPOST -d '{ | |
"query": {"query_string": {"query":"bar"}}, | |
"highlight": {"fields": {"foo.bar":{}}} | |
}' | |
# does not highlight: | |
curl http://localhost:9200/test/_search?pretty -XPOST -d '{ | |
"query": { | |
"boosting": { | |
"positive": { | |
"query_string": { | |
"query":"bar" | |
} | |
}, | |
"negative": {"term": {"foo.bar": "baz"}}, | |
"negative_boost": 0.9 | |
} | |
}, | |
"highlight": {"fields": {"foo.bar":{}}} | |
}' | |
# does not highlight either: | |
curl http://localhost:9200/test/_search?pretty -XPOST -d '{ | |
"query": { | |
"custom_score": { | |
"query": { | |
"query_string": { | |
"query":"bar" | |
} | |
}, | |
"script": "_score" | |
} | |
}, | |
"highlight": {"fields": {"foo.bar":{}}} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment