Skip to content

Instantly share code, notes, and snippets.

@byronvoorbach
Created March 5, 2018 15:20
Show Gist options
  • Save byronvoorbach/94117fcd4967f9c0c5c23d368b31061a to your computer and use it in GitHub Desktop.
Save byronvoorbach/94117fcd4967f9c0c5c23d368b31061a to your computer and use it in GitHub Desktop.
DELETE test
PUT test
{
"settings": {
"number_of_replicas": 0,
"number_of_shards": 1
},
"mappings": {
"test": {
"properties": {
"name" : {
"type": "text"
}
}
}
}
}
POST test/test/1
{
"name" : "Robbert-Jan van Wijhe"
}
POST test/test/2
{
"name" : "Byron Voorbach"
}
POST test/test/3
{
"name" : "Ron Jansen"
}
POST test/test/4
{
"name" : "Jan Bach"
}
POST test/_refresh
GET test/_search
{
"query": {
"bool": {
"should": [
{
"match": {
"name": {
"query": "jan",
"boost": 2
}
}
},
{
"wildcard": {
"name": {
"value": "*jan*"
}
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment