Skip to content

Instantly share code, notes, and snippets.

@brwe
Last active December 26, 2015 23:19
Show Gist options
  • Save brwe/7229896 to your computer and use it in GitHub Desktop.
Save brwe/7229896 to your computer and use it in GitHub Desktop.
DELETE testtags
POST testtags
{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
}
}
POST testtags/test/1
{
"location": "berlin"
}
POST testtags/test/2
{
"location": "berlin berlin"
}
#Should doc 2 not be ranked higher than doc 1?
POST testtags/test/_search
{
"query": {
"match": {
"location": "berlin"
}
}
}
POST testtags/test/3
{
"location": "berlin hamburg"
}
POST testtags/test/4
{
"location": "hamburg"
}
POST testtags/test/_search
{
"query": {
"match": {
"location": "berlin hamburg"
}
}
}
#Should doc 1 and 4 not get the same score?
curl -XDELETE "http://localhost:9200/testtags/"
curl -XPOST "http://localhost:9200/testtags/" -d'
{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
}
}'
curl -XPOST "http://localhost:9200/testtags/test/1" -d'
{
"location": "berlin"
}'
curl -XPOST "http://localhost:9200/testtags/test/2" -d'
{
"location": "berlin berlin"
}'
#Should doc 2 not be ranked higher than doc 1?
curl -XPOST "http://localhost:9200/testtags/test/_search" -d'
{
"query": {
"match": {
"location": "berlin"
}
}
}'
curl -XPOST "http://localhost:9200/testtags/test/3" -d'
{
"location": "berlin hamburg"
}'
curl -XPOST "http://localhost:9200/testtags/test/4" -d'
{
"location": "hamburg"
}'
curl -XPOST "http://localhost:9200/testtags/test/_search" -d'
{
"query": {
"match": {
"location": "berlin hamburg"
}
}
}'
#Should doc 1 and 4 not get the same score?
DELETE testtags
PUT testtags
{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
}
}
POST testtags/test/1
{
"location": "berlin"
}
POST testtags/test/2
{
"location": "berlin berlin"
}
#Should doc 2 not be ranked higher than doc 1?
POST testtags/test/_search
{
"query": {
"match": {
"location": "berlin"
}
}
}
POST testtags/test/3
{
"location": "berlin hamburg"
}
POST testtags/test/4
{
"location": "hamburg"
}
POST testtags/test/_search
{
"query": {
"match": {
"location": "berlin hamburg"
}
}
}
#Should doc 1 and 4 not get the same score?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment