Search
Executes the specified MESL (Magentrix Entity Search Language) query.
When an MESL query is executed, a maximum of 10,000 records can be returned in a single synchronous request.
The response includes the total number of records matching your conditions, which allows you to implement pagination—particularly useful when using the LIMIT clause.
The "Search" endpoint is similar to the query. However, MESL is a programmatic way of performing a text-based search against the search index. Additionally, the returned records are automatically sorted based on their relevancy to the search keywords. Depending on the system settings, Magentrix search may perform either AI keyword or full-text search optimization to improve the query results.
curl POST 'https://{domain}/api/3.0/search'
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization: Bearer {access_token}'
-d 'FIND {How to install Cirot VPN on Mac}
IN BlogPost
WHERE Blog.Name = "Knowledge" AND Blog.Status = "Active"
LIMIT 50
SELECT Name,Body,Thumbnail,Category.Name'
Request Body
query string Required
The request body contains the MESL query string to be executed.
MESL
Use the Magentrix Entity Search Language (MESL) to construct text-based search queries against the search index.
FIND {keywords}
IN {entity_name}
WHERE {conditions}
ORDER BY {field_name} {ASC|DESC}
LIMIT {take},{offset}
SELECT {field1},{field2},{field3},...
Search Components
FIND {keywords} Required
A term on which the search should be performed.
IN {entity_name} Required
The name of the entity to retrieve the data from.
WHERE {conditions...} Optional
The condition expression in a WHERE clause of a MESL query includes one or more field expressions. You can specify multiple field expressions in a condition by using logical operators.
ORDER BY {field_name} {ASC/DESC} Optional
Use this optional ORDER BY clause in the SELECT statement to control the order of the query results. We do not recommend using this option. By default, the search results are sorted based on relevancy ranking.
LIMIT {take},{offset} Optional
LIMIT is an optional clause that can be added to a MESL query to specify the maximum number of rows to return. You can also optionally specify how many rows to skip in the result set.
SELECT {fields...} Optional
A list of fields that are retrieved and displayed in the response in JSON or XML format. The field list in the SELECT statement specifies the list of one or more fields, separated by commas, that you want to retrieve.