Skip to content

Instantly share code, notes, and snippets.

@dadoonet
Created April 15, 2011 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dadoonet/922090 to your computer and use it in GitHub Desktop.
Save dadoonet/922090 to your computer and use it in GitHub Desktop.
Highlighting _all does not work with Elastic Seach
Starting test
{"ok":true,"_index":"test","_type":"dossier","_id":"1","_version":19}
{"ok":true,"_index":"test","_type":"dossier","_id":"2","_version":13}
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [ {
"_index" : "test",
"_type" : "dossier",
"_id" : "1",
"_score" : 1.0, "_source" : { "conformite":"CONFORME", "direction":"DIRECTION"},
"highlight" : {
"conformite" : [ "<em>CONFORME</em>" ]
}
}, {
"_index" : "test",
"_type" : "dossier",
"_id" : "2",
"_score" : 1.0, "_source" : { "conformite":"NONCONFORME", "direction":"BRETAGNE"},
"highlight" : {
"conformite" : [ "<em>NONCONFORME</em>" ]
}
} ]
}
}
{
"took" : 5,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [ {
"_index" : "test",
"_type" : "dossier",
"_id" : "1",
"_score" : 1.0, "_source" : { "conformite":"CONFORME", "direction":"DIRECTION"}
}, {
"_index" : "test",
"_type" : "dossier",
"_id" : "2",
"_score" : 1.0, "_source" : { "conformite":"NONCONFORME", "direction":"BRETAGNE"}
} ]
}
}
echo 'Starting test'
curl -XPUT http://localhost:9200/test/dossier/1 -d '{ "conformite":"CONFORME", "direction":"DIRECTION"}'
echo ''
curl -XPUT http://localhost:9200/test/dossier/2 -d '{ "conformite":"NONCONFORME", "direction":"BRETAGNE"}'
echo ''
curl -XGET http://localhost:9200/test/_search?pretty=true -d '{
"query" : {
"wildcard" : {
"conformite" : "*"
}
},
"highlight" : {
"fields" : {
"conformite" : {}
}
}
}'
echo ''
curl -XGET http://localhost:9200/test/_search?pretty=true -d '{
"query" : {
"wildcard" : {
"conformite" : "*"
}
},
"highlight" : {
"fields" : {
"_all" : {}
}
}
}'
echo ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment