Search Query API

The SearchBlox Collections API enables the user to get related queries and top queries from SearchBlox using simple HTTP POST and GET actions. SearchBlox Collection API provides methods to fetch related and top queries using REST requests with JSON payloads.

New Search API

Search API that is being used for the secure search. Users can also use the same to get JSON results for their search.

URL

https://localhost:8443/searchblox/rest/v2/api/search?query=*&public=true

Method

GET

params

Below given are the basic mandatory parameters. There are a wide variety of parameters that are supported, please refer Search Parameters

paramdescription
querysearch query

Header

HeaderDescription
X-Correlation-IDA unique identifier that can be sent through the search API request.
The X-Correlation-IDs will be logged in ../webapps/searchblox/logs/query.log and can also be viewed in exported query logs file from SearchBlox Analytics.

Returns

The JSON results from SearchBlox by default

Related Queries API

Index URL

https://localhost:8443/searchblox/rest/v2/api/related/query

Method

POST

Media Type

application/json

Headers

content-type : application/json
accept: application/json

Headers

SB-PKEY
LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==

Document Syntax

{
"apikey":"ADB9E38C363A5AB7B17E34956D21543B",
"SB-PKEY":""
"field":"content",
"col":"1,2,3",
"type":"phrase",
"operator":"or",
"limit":20,
"terms":5,
"query":"test"
}

Document Description

JSON FieldsValue
apikeyAPI key accessible in the SearchBlox Admin Console. It is also present in the config.xml file.
fieldfield is the field from which the related search terms are to be fetched eg: content, keywords, title, description or custom meta field
colcollection id
typewhether it is phrase or fuzzy search for related terms
phrase refers to exact match
fuzzy refers to fuzzy match (approximate matches)
operatorAND or OR operator between the terms if multiple words are available in search term
limitnumber of related queries returned
termsnumber of associated terms returned for each query
querysearch query
SB-PKEYSB-PKEY is an additional security key can be found for SBAdmins and Admin Users under Users Tab of Admin Console Screen.

Top Queries API

Index URL

https://localhost:8443/searchblox/rest/v2/api/query/top

Method

POST

Media Type

application/json

Headers

content-type : application/json
accept: application/json

Headers

SB-PKEY
LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==

Document Syntax

{
"apikey":"ADB9E38C363A5AB7B17E34956D21543B",
"col":1,
"limit":12
}

Document Description

JSON FieldsValue
apikeyAPI key accessible in the SearchBlox Admin Console. It is also present in the config.xml file.
colcollection id
limitNumber of top queries returned