Skip to main content
The Advanced Search API allows you to create complex search queries with a SQL-like query language.

Endpoint

GET http://domain.com/api/rest/latest/search/advanced
The API only supports GET requests.

Query parameter

query
string
required
The search query string using the advanced query language.

Response format

records_count
integer
The total number of results, without applying offset and max_results limits.
count
integer
The count of records returned in the current request.
data
array
An array of matching records.

Query language

Keywords

select

Includes field values from the search index as an additional selected_data section in results. Field names should include a type prefix; if omitted, the text type is assumed.
select text.field_name
select (text.first_field_name, text.second_field_name)
Field aliasing is supported:
select text.field_1 as name, text.field_2 as author
select (text.field_1 as name, text.field_2 as author)
Parentheses are mandatory when selecting multiple fields with aliases.

from

Specifies entity aliases to search from. Accepts one or multiple aliases:
from one_alias
from (first_alias, second_alias)

where

Defines search parameters. Use with field type, field name, operator, and value.

and, or

Combine multiple clauses:
and field_type field_name operator value
or field_type field_name operator value
If the field type is omitted, text is used by default.

offset

Sets the offset of the first result.

max_results

Sets the maximum number of results to return.

order_by

Sorts results in ascending or descending order:
order_by field_type field_name direction
If field type is omitted, text is used. Direction is ASC or DESC (defaults to ASC).

Field types

Supported field types: text, integer, decimal, datetime. If a field type is not specified, text is assumed.

Operators for string fields

OperatorDescriptionExample
~ (CONTAINS)Field contains the value.name ~ value or name ~ "string value"
!~ (NOT CONTAINS)Field does not contain the value.name !~ value
likeField contains the substring (LIKE %value%).name like "string value"
notlikeField does not contain the substring.name notlike "string value"

Operators for numeric fields

OperatorDescriptionExample
=Equalsinteger count = 100
!=Not equalsinteger count != 5
>Greater thaninteger count > 5
<Less thandecimal price < 45
>=Greater than or equalinteger count >= 5
<=Less than or equalinteger count <= 10
inValue is in the specified setinteger count in (5, 10, 15, 20)
!inValue is not in the specified setinteger count !in (1, 3, 5)

Query brackets

Combine operators using parentheses:
from oro_test where (owner ~ john and (integer count > 10 or float price = 10)) or (owner ~ mary and (integer count > 5 or float price = 150))

Query examples

Search products containing “opportunity” with price greater than 100:
from demo_product where name ~ opportunity and double price > 100
Return entity data plus name and description fields:
select (name, description) from demo_product
All entities where integer count is not 10:
integer count != 10
All entities where the all_text field does not contain “opportunity”:
all_text !~ "opportunity"
10 results from demo_products and demo_categories where description contains “test”, sorted ascending by name, offset by 5:
from (demo_products, demo_categories) where description ~ test order_by name offset 5 max_results 10

Build docs developers (and LLMs) love