The Search Component API allows you to configure the list of active search components for each particular search handler.
One example of when you'd need to use this API is when you create a new filter with the Filtering API to support limiting results to only authorized users as defined by Windows Access Control Lists. Once the filter is created, you must add the searchComponent name to the /lucid request handler with this API.
An understanding of Solr's search component functionality is helpful when using this API.
API Entry Point
/api/collections/collection/components/list-name?handlerName=/handlerName: List or update search components for a search handler.
List Search Components
GET /api/collections/collection/components/list-name?handlerName=/handlerName
Input
Path Parameters
| Key | Description |
|---|---|
| collection | The collection name. |
| list-name | The Solr search component list name: all, first, or last. The all list, if present, contains all the search components for your request handler. The first list, if present, appends the additional search components of your search handler to the beginning of the default list the request handler inherits from its parent class. The last list, if present, appends the additional search components of your search handler to the end of the default list the handler inherits from its parent class. You cannot create new lists using this API; you can only work with lists that already exist for your request handler. |
Query Parameters
| Key | Description |
|---|---|
| handlerName | The name of request handler; use /lucid for the standard LucidWorks Search query request handler. |
Output
Output Content
JSON array of current search components.
Examples
Get the search components for /lucid request handler in the social collection.
Input
curl 'http://localhost:8888/api/collections/social/components/all?handlerName=/lucid'
Output
["rolefiltering","query","mlt","stats","feedback","highlight","facet","spellcheck","debug"]
Update Search Components
PUT /api/collections/collection/components/list-name?handlerName=/handlerName
Input
Input Content
JSON array with all of the components.
Path Parameters
| Key | Description |
|---|---|
| collection | The collection name. |
| list-name | The Solr search component list name: all, first, or last. The all list, if present, contains all the search components for your request handler. The first list, if present, appends the additional search components of your search handler to the beginning of the default list the request handler inherits from its parent class. The last list, if present, appends the additional search components of your search handler to the end of the default list the handler inherits from its parent class. You cannot create new lists using this API; you can only work with lists that already exist for your request handler. |
Query Parameters
| Key | Description |
|---|---|
| handlerName | The name of the request handler; use /lucid for the standard LucidWorks Search query request handler. |
Output
Output Content
None.
Response Codes
200: Success OK
Examples
Set the list of search components for /lucid request handler in the social collection.
Input
curl -v -X PUT http://localhost:8888/api/collections/social/components/all?handlerName=/lucid -H "Accept: application/json" -H "Content-Type: application/json" -d '["adfiltering","query","mlt","stats","feedback","highlight","facet","spellcheck","debug"]'
Output
None.