Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 3.19 KB

File metadata and controls

71 lines (50 loc) · 3.19 KB
code type title description
true
page
searchSpecifications
Search for specifications

searchSpecifications

Searches collection specifications.

There is a limit to how many items can be returned by a single search query. That limit is by default set at 10000, and you can't get over it even with the from and size pagination options.

:::info When processing a large number of items (i.e. more than 1000), it is advised to paginate the results using SearchResult.next rather than increasing the size parameter. :::


searchSpecifications([body], [options]);

Arguments Type Description
body
object
An object containing the search query
options
object
Query options

body

The body is a set of filters using Elasticsearch Query DSL to match the documents you are looking for. The filters must be inside the query property of the body.

Example:

const body = {
  query: {
    match_all: {
      boost: 1
    }
  }
};

options

Arguments Type Description
queuable
boolean

(true)
Make this request queuable or not
from
number

(0)
Offset of the first document
size
number

(10)
Maximum number of documents returned
scroll
string

Maximum duration for scroll session
timeout
number
Time (in ms) during which a request will still be waited to be resolved. Set it -1 if you want to wait indefinitely
  • size controls the maximum number of documents returned in the response
  • from is usually used with the size argument, and defines the offset from the first result you want to fetch
  • scroll is used to fetch large result sets, and it must be set with a time duration. If set, a forward-only cursor will be created (and automatically destroyed at the end of the set duration), and its identifier will be returned in the scrollId property, along with the first page of the results.

Resolves

Resolve to a SpecificationsSearchResult.

Usage

<<< ./snippets/search-specifications.js