Query Profiles API
- Examples
- Query Profiles API Endpoint Specs
The Query Profiles API allows users to manage query profiles. Query profiles allow users to change query pipelines during search time while pointing the search toward a static endpoint. This gives flexibility to test different stage combinations without reconfiguration. For information, see Query Profiles.
Examples
Create a profile named 'testProfile' for the 'docs' collection and associate it with the pipeline named 'docs-default':
REQUEST
curl -u user:pass -X PUT -H 'Content-type: application/json' -d '"docs-default"' http://localhost:8764/api/apollo/collections/docs/query-profiles/testProfile
RESPONSE
None.
Query for the term 'title:fusion' in the 'docs' collection, using the profile named 'newProfile':
INPUT
curl -u user:pass http://localhost:8764/api/apollo/collections/docs/query-profiles/newProfile/select?q=title:fusion&wt=json&fl=title
Note that we have also added a few other query parameters, such as 'wt=json' to get the results in JSON format, and 'fl=title' to only retrieve document titles.
OUTPUT
{
"response": {
"numFound": 85,
"start": 0,
"docs": [
{
"title": [
"Fusion Services - Fusion Documentation - Lucidworks"
]
},
{
"title": [
"Lucidworks Fusion Documentation - Fusion Documentation - Lucidworks"
]
},
{
"title": [
"Installation - Fusion Documentation - Lucidworks"
]
},
{
"title": [
"Searching - Fusion Documentation - Lucidworks"
]
},
{
"title": [
"Collections - Fusion Documentation - Lucidworks"
]
},
{
"title": [
"Recommendations - Fusion Documentation - Lucidworks"
]
},
{
"title": [
"Connectors - Fusion Documentation - Lucidworks"
]
},
{
"title": [
"Reporting - Fusion Documentation - Lucidworks"
]
},
{
"title": [
"Schedules - Fusion Documentation - Lucidworks"
]
},
{
"title": [
"Profiles - Fusion Documentation - Lucidworks"
]
}
]
},
"responseHeader": {
"status": 0,
"QTime": 1,
"params": {
"facet": "true",
"fl": "title",
"lw.pipelineId": "docs-default",
"q": "title:fusion",
"wt": "json",
"defType": "edismax",
"rows": "10"
}
}
}