Gleanex.Client.Search (Gleanex v0.1.0)

Copy Markdown View Source

Provides API endpoints related to search

Summary

Functions

Search the index (admin)

Feed of documents and events

Recommend documents

Functions

adminsearch(body, opts \\ [])

@spec adminsearch(body :: Gleanex.Client.SearchRequest.t(), opts :: keyword()) ::
  {:ok, Gleanex.Client.SearchResponse.t()} | {:error, Gleanex.Error.t()}

Search the index (admin)

Retrieves results for search query without respect for permissions. This is available only to privileged users.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.

Request Body

Content Types: application/json

Admin search request

autocomplete(body, opts \\ [])

@spec autocomplete(body :: Gleanex.Client.AutocompleteRequest.t(), opts :: keyword()) ::
  {:ok, Gleanex.Client.AutocompleteResponse.t()} | {:error, Gleanex.Error.t()}

Autocomplete

Retrieve query suggestions, operators and documents for the given partially typed query.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.

Request Body

Content Types: application/json

Autocomplete request

feed(body, opts \\ [])

@spec feed(body :: Gleanex.Client.FeedRequest.t(), opts :: keyword()) ::
  {:ok, Gleanex.Client.FeedResponse.t()} | {:error, Gleanex.Error.t()}

Feed of documents and events

The personalized feed/home includes different types of contents including suggestions, recents, calendar events and many more.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.

Request Body

Content Types: application/json

Includes request params, client data and more for making user's feed.

recommendations(body, opts \\ [])

@spec recommendations(
  body :: Gleanex.Client.RecommendationsRequest.t(),
  opts :: keyword()
) ::
  {:ok, Gleanex.Client.RecommendationsResponse.t()}
  | {:error, Gleanex.Error.t()}

Recommend documents

Retrieve recommended documents for the given URL or Glean Document ID.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.

Request Body

Content Types: application/json

Recommendations request

search(body, opts \\ [])

@spec search(body :: Gleanex.Client.SearchRequest.t(), opts :: keyword()) ::
  {:ok, Gleanex.Client.SearchResponse.t()} | {:error, Gleanex.Error.t()}

Search

Retrieve results from the index for the given query and filters.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.

Request Body

Content Types: application/json

Search request