Skip to main content

Search Engine Model

Search Parameters for use with Search API

Description

The Search Engine Model is an array of objects containing search engine parameters. These parameters allow customizing searches made through Cotalker's Search API.

The Search Engine Model has the following general structure: [{"name": string, "options": object}].

important

The Search Engine Model must be converted to Base64 format for it to be used in the Search API.

JSON Sample

[{
"name": "tasksElastic",
"options": {
"entityType": "hedgedoc",
"limit": 10,
"groups": ["62bf5e03654e964e3800e461"]
}
},
{
"name": "users",
"options": {
"limit": 10
}
}

]

Encoded sample:

W3sKICAgICAgICAibmFtZSI6ICJ0YXNrc0VsYXN0aWMiLAogICAgICAgICJvcHRpb25zIjogewogICAgICAgICAgICAiZW50aXR5VHlwZSI6ICJoZWRnZWRvYyIsCiAgICAgICAgICAgICJsaW1pdCI6IDEwLAogICAgICAgICAgICAiZ3JvdXBzIjogWyI2MmJmNWUwMzY1NGU5NjRlMzgwMGU0NjEiXQogICAgICAgIH0KICAgIH0sCiAgICB7CiAgICAgICAgIm5hbWUiOiAidXNlcnMiLAogICAgICAgICJvcHRpb25zIjogewogICAgICAgICAgICAibGltaXQiOiAxMAogICAgICAgIH0KICAgIH0KCl0=
tip

To encode the array into Base 64 format, you can use a tool like Base64.

Fields

FieldDescriptionTypeNotes
nameIndicates the search category or type that is being configured.
Options are:
users | tasks | public-tasks | channels | properties | tasksElastic
stringtasksElastic is a "smarter" search engine, i.e., it enables flexible search rules that allows the engine to return additional results that are not exact but similar to the search query.

public-tasks is still in beta.
optionsIndicates the parameters used to filter searches in the given category or type.objectParameters are relative to the category, e.g., the parameters for searching properties follow the descriptions of parameters available in the Properties API.
options.adminAvailable only when name is set to tasksElastic, tasks, channels, properties, users.boolean
options.createdDisplays results created on the indicated date and time.DateAccepts either ISODate or Unix Epoch Time formats.
options.createdGtDisplays results created after the indicated date and time.DateAccepts either ISODate or Unix Epoch Time formats.
options.createdGteDisplays results created on or after the indicated date and time.DateAccepts either ISODate or Unix Epoch Time formats.
options.createdLtDisplays results created before the indicated date and time.DateAccepts either ISODate or Unix Epoch Time formats.
options.createdLteDisplays results created on or before the indicated date and time.DateAccepts either ISODate or Unix Epoch Time formats.
options.disableSerialBy default, if a query begins with a number, e.g., #18 or 18, tasks with that serial number will be returned in the response. If activated, this behavoir is disabled.booleanThis allows you to search through task names that have numbers in them and avoid including the automatically generated task serial number.
options.entityTypeAvailable only when name is set to tasksElastic. Indicates the task-associated category or type in which to carry out the "elastic" (smart) search. If no entityType is given, the taskElastic engine will search through all its categories.stringOptions are:
task | hedgedoc | property | channel | user

hedgedoc refers to notes contained within tasks.
options.groupsLimits search within the groups specified in the array."COTGroup<\ObjectId>"[ ]Available only when name is set to tasksElastic, tasks, channels.
options.isActiveDisplays results depending on their isActive status.boolean or all,
options.limitLimits the number of search results returned in a single page.numberBy default, limit is set to 2.
options.orderByOrders results in ascending or descending order.asc or desc,
options.pageDisplays the results of the indicated page.numberUsed best with the limit parameter.
options.modifiedDisplays results based on the date and time they were modified.DateAccepts either ISODate or Unix Epoch Time formats.
options.modifiedGtDisplays results modified after the indicated date and time.DateAccepts either ISODate or Unix Epoch Time formats.
options.modifiedGteDisplays results modified on or after the indicated date and time.DateAccepts either ISODate or Unix Epoch Time formats.
options.modifiedLtDisplays results modified before the indicated date and time.DateAccepts either ISODate or Unix Epoch Time formats.
options.modifiedLteDisplays results modified on or before the indicated date and time.DateAccepts either ISODate or Unix Epoch Time formats.
options.sortBySorts results by the indicated field. Sorting is carried out using the available parameter options in the respective API request, i.e., channels can be sorted according to the sortBy options in the Channels API.string