Skip to content

Instantly share code, notes, and snippets.

@arey
Last active December 28, 2015 03:39
Show Gist options
  • Save arey/7436834 to your computer and use it in GitHub Desktop.
Save arey/7436834 to your computer and use it in GitHub Desktop.
Search query that could be used for completion suggestions on the MusicBrainz Elasticsearch index created by the batch provided in the https://github.com/arey/musicbrainz-elasticsearch repository.
curl -XPOST 'http://es.javaetmoi.com/musicalbum/album/_search?pretty' -d '
{
"fields": [
"artist.name",
"id",
"name",
"year.string"
],
"query": {
"query_string": {
"fields": [
"name",
"name.start",
"year.string",
"artist.name",
"artist.name.start"
],
"query": "U2",
"use_dis_max": false,
"auto_generate_phrase_queries": true,
"default_operator": "OR"
}
},
"highlight": {
"number_of_fragments": 0,
"pre_tags": [
"<b>"
],
"post_tags": [
"</b>"
],
"fields": {
"artist.name": {},
"name": {},
"year.string": {}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment