Searches for a phrase inside project version in a given language
Header
Parameter
Type
Description
api_token
string
You can get the REST API from Settings > Advanced > API tokens.
Route Parameters
Parameter
Required
Type
Description
id
Yes
string
The ID of the project version
langCode
Yes
string
LanguageCode for multilingual (Default value is en)
page
No
number
Specify the page to retrieve. Page numbers are zero-based. So, to retrieve the 10th page, you need to set the page as 9. The default value is 0.
hitsPerPage
No
number
Number of records/results to be fetched per page. The default value is 10.
Query Parameters
Parameter
Required
Type
Description
searchQuery
No
string
The phrase to search across all articles in the project version for the given language
Sample Response
{
"data": {
"hits": [
{
"title": "Why did we build Document360?",
"content": "Thank you very much for signing up for Document360.",
"isHidden": true,
"tags": "123",
"slug": "hello-why-doc360",
"version": 7,
"articleId": "4f52cd46-ca5c-4dc2-8ae1-16030e0ba168",
"categoryId": "bf973e0b-583d-4ad4-9ae1-c713d7a18181",
"isCategoryHidden": false,
"order": 1,
"isDraft": false,
"exclude": false,
"objectID": "c9c97758-bd24-43b0-a916-d45d7b9b6d18",
"_snippetResult": {
"content": {
"value": "Thank you very much for signing up for Document360.\nDocument360 is born out of our own frustrations in writing product <em>documentation</em> for our other products for the past 5+ years. We initially started the hunt to find a suitable alternative product in the market to strengthen our product <em>documentation.</em>\nAfter",
"matchLevel": "partial"
}
},
"_highlightResult": {
"title": {
"value": "Why did we build Document360?",
"matchLevel": "none",
"matchedWords": []
}
}
}
],
"nbHits": 6,
"page": 0,
"nbPages": 1,
"hitsPerPage": 20,
"processingTimeMS": 1,
"exhaustiveNbHits": true,
"query": "api documentation",
"params": "query=api+documentation"
},
"extension_data": null,
"context": null,
"success": true,
"errors": [],
"warnings": [],
"information": []
}
Response Data
Parameter
Type
Description
hits
object[]
The results of the search
nbHits
number
The number of hits matched by the query.
page
number
Index of the current page (zero-based).
nbPages
number
The number of returned pages. The calculation is based on the total number of hits (nbHits) divided by the number of hits per page (hitsPerPage), rounded up to the nearest integer.
hitsPerPage
number
The maximum number of hits returned per page.
processingTimeMS
number
The time the server took to process the request(in milliseconds). This does not include network time.
exhaustiveNbHits
boolean
Whether the nbHits is exhaustive (true) or approximate (false). An approximation is done when the query takes more than 50ms(millisecond) to be processed (this can happen when using complex filters on millions of records).
query
string
An echo of the query text.
params
string
A URL-encoded string of all search parameters.
Response > hits
Hits object is a response coming from Algolia APIs, below you will find some information about the values, you can read more on their documentation
Parameter
Type
Description
title
string
Article title
content
string
Article HTML content
isHidden
boolean
Indicates if the article is visible on the site
tags
string[]
Custom article tags
slug
string
The slug of the article
version
string
The version number that is currently published
articleId
string
The ID of the article
categoryId
string
The ID of the category
isCategoryHidden
boolean
Indicates if category is visible on the site
order
number
The position inside the parent category
isDraft
boolean
Indicates if the article is marked as a draft
exclude
boolean
Indicates if the article is excluded from search results on user website
objectId
string
algolia search object ID
snipetResult
object
Markup text with occurrences highlighted.
highlightResult
object
Highlighted attributes
Hits > snippetResult
Parameter
Type
Description
value
string
Markup text with occurrences highlighted.
matchLevel
string
Indicates how well the attribute matched the search query. Can be: none, partial, full
Hits > highlightResult
Parameter
Type
Description
value
string
Markup text with occurrences highlighted.
matchLevel
string
Indicates how well the attribute matched the search query. Can be: none, partial, full
matchedWords
string[]
List of words from the query that matched the object.
Was this article helpful?
Thank you for your feedback! Our team will get back to you
By clicking on "Accept cookies", you consent to the use of only necessary/essential cookies to enhance the Document360 knowledge base site navigation, analyze site usage, and assist in our marketing efforts. For more details, please read our Privacy policy.