Search inside project version
  • 02 Sep 2020
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

Search inside project version

  • Dark
    Light

GET/projectversions/{id}/{langcode}

Searches for a phrase inside project version in given language


Parameter Type Description
api_token string REST API key you can get it from Settings > API.

Route Parameters

You can filter the results using the following parameters

Parameter Type Description
id string ID of the project version
langcode string LanguageCode for multilingual (Default value is en)

Query Parameters

You can filter the results using the following parameters

Parameter Type Description
search_query string The phrase to search across all articles in any given language from the project version

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. 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 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 to be processed (this can happen when using complex filters on millions on 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 cotent
isHidden boolean Indicates if article is visible in 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 ID of the article
categoryId string ID of the category
isCategoryHidden boolean Indicates if category is visible in on the site
order number The position inside the parent category
isDraft boolean Indicates if article is marked as draft
exclude boolean Indicates if 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 > snipetResult

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?

What's Next