Skip to content

Instantly share code, notes, and snippets.

@matteomanzo
Last active March 26, 2018 13:13
Show Gist options
  • Save matteomanzo/a7ffb82c312a3b3f4d027fb681e49ef6 to your computer and use it in GitHub Desktop.
Save matteomanzo/a7ffb82c312a3b3f4d027fb681e49ef6 to your computer and use it in GitHub Desktop.
Process of a basic Mastico query
{
"body": {
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"term": {
"title": {
"value": "venere",
"boost": 1
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"term": {
"author": {
"value": "venere",
"boost": 1
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"prefix": {
"title": {
"value": "venere",
"boost": 0.7
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"prefix": {
"author": {
"value": "venere",
"boost": 0.7
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"wildcard": {
"title": {
"value": "*venere*",
"boost": 0.4
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"wildcard": {
"author": {
"value": "*venere*",
"boost": 0.4
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"fuzzy": {
"title": {
"value": "venere",
"fuzziness": 4,
"boost": 0.2
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"fuzzy": {
"author": {
"value": "venere",
"fuzziness": 4,
"boost": 0.2
}
}
}
],
"minimum_should_match": 0
}
}
]
}
},
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"term": {
"title": {
"value": "botticelli",
"boost": 1
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"term": {
"author": {
"value": "botticelli",
"boost": 1
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"prefix": {
"title": {
"value": "botticelli",
"boost": 0.7
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"prefix": {
"author": {
"value": "botticelli",
"boost": 0.7
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"wildcard": {
"title": {
"value": "*botticelli*",
"boost": 0.4
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"wildcard": {
"author": {
"value": "*botticelli*",
"boost": 0.4
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"fuzzy": {
"title": {
"value": "botticelli",
"fuzziness": 4,
"boost": 0.2
}
}
}
],
"minimum_should_match": 0
}
},
{
"bool": {
"should": [
{
"fuzzy": {
"author": {
"value": "botticelli",
"fuzziness": 4,
"boost": 0.2
}
}
}
],
"minimum_should_match": 0
}
}
]
}
}
]
}
}
},
"index": [
"development_uffizi_it"
],
"type": [
"artwork"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment