Skip to content

Instantly share code, notes, and snippets.

@pib
Last active March 2, 2017 17:11
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 pib/db54751b6bd9c5c8a1e1463714a2cb73 to your computer and use it in GitHub Desktop.
Save pib/db54751b6bd9c5c8a1e1463714a2cb73 to your computer and use it in GitHub Desktop.
{
"query": {
"bool": {
"should": [
{
"simple_query_string": {
"fields": [
"name^3",
"description",
"service_location",
"internal_search_terms"
],
"query": "food"
}
},
{
"simple_query_string": {
"fields": [
"city.lower^2",
"state.lower",
"address.lower",
"phone",
"website.lower"
],
"query": "food"
}
}
]
}
}
}
{
"_index": "pubdata-dev",
"_type": "businesses",
"_id": "d4019fd1-76e4-4780-86f8-052d353c0f4a",
"matched": true,
"explanation": {
"value": 0.12322411,
"description": "product of:",
"details": [
{
"value": 0.24644822,
"description": "sum of:",
"details": [
{
"value": 0.24644822,
"description": "sum of:",
"details": [
{
"value": 0.24644822,
"description": "weight(description:food in 5126) [PerFieldSimilarity], result of:",
"details": [
{
"value": 0.24644822,
"description": "score(doc=5126,freq=1.0), product of:",
"details": [
{
"value": 0.14462084,
"description": "queryWeight, product of:",
"details": [
{
"value": 7.7901664,
"description": "idf(docFreq=1401, maxDocs=1246464)"
},
{
"value": 0.018564537,
"description": "queryNorm"
}
]
},
{
"value": 1.7040989,
"description": "fieldWeight in 5126, product of:",
"details": [
{
"value": 1,
"description": "tf(freq=1.0), with freq of:",
"details": [
{
"value": 1,
"description": "termFreq=1.0"
}
]
},
{
"value": 7.7901664,
"description": "idf(docFreq=1401, maxDocs=1246464)"
},
{
"value": 0.21875,
"description": "fieldNorm(doc=5126)"
}
]
}
]
}
]
}
]
}
]
},
{
"value": 0.5,
"description": "coord(1/2)"
}
]
}
}
{
"_index": "pubdata-dev",
"_type": "businesses",
"_id": "d4019fd1-76e4-4780-86f8-052d353c0f4a",
"matched": true,
"explanation": {
"value": 4.332623,
"description": "sum of:",
"details": [
{
"value": 4.332623,
"description": "sum of:",
"details": [
{
"value": 4.332623,
"description": "sum of:",
"details": [
{
"value": 4.332623,
"description": "weight(description:food in 44478) [PerFieldSimilarity], result of:",
"details": [
{
"value": 4.332623,
"description": "score(doc=44478,freq=1.0 = termFreq=1.0\n), product of:",
"details": [
{
"value": 3.4471126,
"description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:",
"details": [
{
"value": 1661,
"description": "docFreq",
"details": []
},
{
"value": 52186,
"description": "docCount",
"details": []
}
]
},
{
"value": 1.2568847,
"description": "tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:",
"details": [
{
"value": 1,
"description": "termFreq=1.0",
"details": []
},
{
"value": 1.2,
"description": "parameter k1",
"details": []
},
{
"value": 0.75,
"description": "parameter b",
"details": []
},
{
"value": 41.76256,
"description": "avgFieldLength",
"details": []
},
{
"value": 20.897959,
"description": "fieldLength",
"details": []
}
]
}
]
}
]
}
]
}
]
},
{
"value": 0,
"description": "match on required clause, product of:",
"details": [
{
"value": 0,
"description": "# clause",
"details": []
},
{
"value": 1,
"description": "_type:businesses, product of:",
"details": [
{
"value": 1,
"description": "boost",
"details": []
},
{
"value": 1,
"description": "queryNorm",
"details": []
}
]
}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment