Custom Collection
A Custom Collection allows you to index and search your own content by sending data directly to SearchBlox through the REST API. This is useful when your content originates from a custom application, internal system, database, or any source that is not supported by the built-in collection types.
Before You Begin
Before creating and indexing a Custom Collection, obtain the following credentials:
- API Key: Navigate to Administration > License to retrieve your API key.
- SB-PKEY: A Super Admin or Admin can obtain the SB-PKEY from Administration > Users.
Note: The SB-PKEY is required for all API requests.

To get your SB-PKEY, a Super Admin or Admin can go to Administration > Users.

Creating a Custom Collection
Follow these steps to create a Custom Collection:
- Log in to the Admin Console.
- Go to the Collections tab.
- Click "Create a New Collection" or the "+" icon.
- Select "Custom Collection" as the collection type.
- Enter a unique name for the collection (e.g., "Custom API").
- Set Collection Access (Private or Public).
- Configure Collection Encryption as per your security requirements.
- Choose the content language (if not English).
- Click Save to create the collection.
- After creation, you will be taken to the Path tab to configure the collection.


Custom Collection Settings
- To learn more details on REST-API, parameters and URLs read REST API.
- The following table has the list of basic settings available in Custom collection
| Setting | Description |
|---|---|
| Relevance Stemming | When enabled, words are reduced to their root form. For example, "running", "runs", and "ran" all become "run". |
| Relevance Spelling Suggestions | Provides spelling suggestions for the collection. Default is YES. |
| Keyword-in-Context Display | Shows search results with the description from the content area where the search term appears. |
| HTML Parser Settings | Configures the HTML parser to read the description from HTML tags: H1, H2, H3, H4, H5, H6. |
| HTTP Basic Authentication | Sends username and password to the HTTP server in the Authorization header when requesting a document. Required attributes: username and password |
| HTTP Proxy Server Setting | Required when accessing HTTP content through a proxy server. Needed attributes: Proxy Server URL, Username, and Password. |
| Enable Content API | Allows crawling document content that includes special characters. |

SearchBlox API Explorer
-
SearchBlox has a built-in tool called API Explorer to try out APIs with examples.
-
Access the API Explorer at: https://localhost:8443/api
-
The link is also available when selecting the custom collection path.
-
Using API Explorer, you can perform these REST API actions for Custom Collections:
- Create Collection
- Clear Collection
- Delete Collection
- Index Document
- Update Document Metadata
- Delete Document
-
For other API requests, you can use tools like Postman.
-
SB-PKEY is required for all API requests. In API Explorer, use the Private Key text box; in Postman, set it in the header parameter.
Note: Enter your SB-PKEY in the Private Key text box when using the API Explorer. When using Postman, include the SB-PKEY as a request header.
The SearchBlox REST API requires all requests to be submitted in JSON format. For API operations that are not supported by the API Explorer, use a tool such as Postman to send and test requests.
Note: SearchBlox also supports HTTP API and other APIs. These APIs are not currently compatible with the API Explorer and must be tested using Postman or a similar API client.

- The SearchBlox REST API requires JSON input.
- Click "Try it out" to edit the JSON request.
- Provide the correct API key, collection name, location, and other required details.
- During indexing, the JSON request is shown in pop-ups, followed by a status message once the operation completes.


SearchBlox also supports HTTP API and other APIs, but they are not compatible with API Explorer right now. Tools such as PostmanAPI can be used to try out HTTP API.
