An understanding of Solr's [search component|solr:RequestHandlers and SearchComponents in SolrConfig] functionality is helpful when using this API.
{toc}
h2. API Entry Point
{{[/api/collections/_collection_/components/_list-name_?handlerName=/_handlerName_|#search-comp-get]}}: [List|#search-comp-get] or [update|#search-comp-put] search components for a search handler.
{anchor:search-comp-get}
h2. List Search Components
!LucidWorks REST API Reference^bullet.jpg! {{GET /api/collections/}}{{{}{_}collection{_}{}}}{{/components/}}{{{}{_}list-name{_}{}}}{{?handlerName=/}}{{{}{_}handlerName{_}}}
h4. {bgcolor:#FEECC4}{*}Input{*}{bgcolor}
*Path Parameters*
|| Key || Description ||
| collection | The collection name. |
| list-name | The [Solr search component|solr:RequestHandlers and SearchComponents in SolrConfig] 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. |
h4. {bgcolor:#FEECC4}{*}Output{*}{bgcolor}
*Output Content*
JSON array of current search components.
h4. {bgcolor:#FEECC4}{*}Examples{*}{bgcolor}
Get the search components for {{/lucid}} request handler in the {{social}} collection.
*Input*
{code:borderStyle=solid|borderColor=#666666}
curl 'http://localhost:8888/api/collections/social/components/all?handlerName=/lucid'
{code}
*Output*
{code:borderStyle=solid|borderColor=#666666}
["rolefiltering","query","mlt","stats","feedback","highlight","facet","spellcheck","debug"]
{code}
{topofpage}
{anchor:search-comp-put}
h2. Update Search Components
!LucidWorks REST API Reference^bullet.jpg! {{PUT /api/collections/}}{{{}{_}collection{_}{}}}{{/components/}}{{{}{_}list-name{_}{}}}{{?handlerName=/}}{{{}{_}handlerName{_}}}
h4. {bgcolor:#FEECC4}{*}Input{*}{bgcolor}
*Input Content*
JSON array with all of the components.
*Path Parameters*
|| Key || Description ||
| collection | The collection name. |
| list-name | The [Solr search component|solr:RequestHandlers and SearchComponents in SolrConfig] 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. |
h4. {bgcolor:#FEECC4}{*}Output{*}{bgcolor}
*Output Content*
None.
*Response Codes*
200: Success OK
h4. {bgcolor:#FEECC4}{*}Examples{*}{bgcolor}
Set the list of search components for {{/lucid}} request handler in the {{social}} collection.
*Input*
{code:borderStyle=solid|borderColor=#666666}
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"]'
{code}
*Output*
None.
{topofpage}
{navbar}