Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 3.11 KB

File metadata and controls

62 lines (41 loc) · 3.11 KB
code type title description
true
page
searchUsers
Searches users

searchUsers

Searches users.


searchUsers([query], [options]);

Property Type Description
query
object
Search query
options
object
Query options

query

The search query to apply to users content, using ElasticSearch Query DSL or the Koncorde Filters DSL syntax.

This method also supports the Koncorde Filters DSL to match documents by passing the lang argument with the value koncorde.
Koncorde filters will be translated into an Elasticsearch query.

::: warning Koncorde bool operator and regexp clause are not supported for search queries. :::

If left empty, the result will return all available users.

options

Property Type
(default)
Description
queuable
boolean

(true)
If true, queues the request during downtime, until connected to Kuzzle again
from
number

(0)
Offset of the first document to fetch
size
number

(10)
Maximum number of documents to retrieve per page
scroll
string

("")
When set, gets a forward-only cursor having its ttl set to the given value (ie 30s; cf elasticsearch time limits)
lang
string
Specify the query language to use. By default, it's elasticsearch but koncorde can also be used.

Resolves

A SearchResult object containing the retrieved User objects.

Usage

With the ElasticSearch Query DSL syntax.

<<< ./snippets/search-users-es.js

With the Koncorde Filters DSL syntax.

<<< ./snippets/search-users-koncorde.js