Skip to content

Instantly share code, notes, and snippets.

@jprante
Created December 30, 2014 09:11
Show Gist options
  • Save jprante/85126685973311603c8a to your computer and use it in GitHub Desktop.
Save jprante/85126685973311603c8a to your computer and use it in GitHub Desktop.
multi_match and boost
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test'
curl -XPUT 'localhost:9200/test/test/_mapping' -d '
{
"test": {
"properties": {
"custom_all":{
"type": "string"
},
"name":{
"type": "string"
},
"surName":{
"type": "string"
},
"dateRecorded":{
"type": "date"
},
"Id":{
"type": "long"
}
}
}
}
'
curl -XGET 'localhost:9200/test/_mapping'
curl -XPUT 'localhost:9200/test/test/1' -d '
{
"surName" : "Preeti"
}
'
curl -XPUT 'localhost:9200/test/test/2' -d '
{
"name" : "Preeti"
}
'
curl -XGET 'localhost:9200/test/_refresh'
curl -XGET 'localhost:9200/test/_search?pretty' -d '
{
"query": {
"multi_match": {
"query" : "Preeti",
"fields" : [ "name^2", "surName" ]
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment