import requests
url = "https://{FUSION HOST}/api/query/{id}"
payload = {
"queryDefinition": {
"main": { "type": "<string>" },
"boostsByValues": [
{
"field": "<string>",
"boosts": [
{
"key": "<string>",
"boost": 100
}
]
}
],
"boostsByQuery": [
{
"query": { "type": "<string>" },
"boost": 123,
"type": "<string>"
}
],
"userQuery": "<string>",
"filters": [{ "type": "<string>" }],
"namedFilters": [
{
"name": "<string>",
"query": { "type": "<string>" }
}
],
"groupedQuery": { "type": "<string>" },
"groupedFilters": [{ "type": "<string>" }]
},
"results": {
"cursor": "<string>",
"start": 0,
"size": 123,
"sort": [
{
"type": "field",
"value": "<string>",
"order": "asc",
"query": { "type": "<string>" }
}
],
"fields": ["<string>"],
"highlight": {
"fields": ["<string>"],
"pre": "<em>",
"post": "</em>",
"length": 100,
"count": 1,
"defaultHighlight": False
},
"returnScore": True,
"includeRawResponse": True,
"group": {
"field": "<string>",
"leaderStrategy": { "type": "<string>" },
"sort": [
{
"type": "field",
"value": "<string>",
"order": "asc",
"query": { "type": "<string>" }
}
],
"size": 123
}
},
"params": {},
"context": {},
"facets": {
"fields": [
{
"field": "<string>",
"prefix": "<string>",
"sort": "count",
"limit": 100,
"offset": 0,
"minCount": 123,
"missing": True,
"ensuredValues": ["<string>"],
"domain": {
"additionalFilters": [{ "type": "<string>" }],
"excludedFiltersByName": ["<string>"]
}
}
],
"ranges": [
{
"field": "<string>",
"start": "<string>",
"end": "<string>",
"gap": "<string>",
"hardEnd": True,
"minCount": 123,
"include": ["lower"],
"other": ["before"],
"domain": {
"additionalFilters": [{ "type": "<string>" }],
"excludedFiltersByName": ["<string>"]
}
}
],
"groupFacets": True,
"groupingMethod": "unique"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())