Skip to main content
Version: 1.0.0

Search

Some of our /GET endpoints support filter option.

Our search API allows you to perform complex queries on our dataset using a Lucene-like query syntax.

Supported Query Syntax


Logical Expressions

Logical expressions allow you to combine multiple conditions using logical operators:

  • AND Combine conditions that must all be true.
  • OR Combine conditions where at least one must be true.
  • : or := These operators are used to specify that the field should exactly match the given value. For example, field:value means the field must be exactly equal to the value.
    • := must be used in case of integer or boolean
  • :> This operator is used to specify that the field should be greater than the given value. For example, field:>value means the field must be greater than the value.
  • :>= This operator is used to specify that the field should be greater than or equal to the given value. For example, field:>=value means the field must be greater than or equal to the value.
  • :< This operator is used to specify that the field should be less than the given value. For example, field:<value means the field must be less than the value.
  • :<= This operator is used to specify that the field should be less than or equal to the given value. For example, field:<=value means the field must be less than or equal to the value.

Warning
Logical expression must be in uppercase ! otherwise it will result as a bad request ! expr1:val1 and expr2:val2 is wrong expr1:val1 AND expr2:val2 is OK

Wildcard Searches

Wildcard searches enable pattern matching within your queries

Return truthy if name start by string val

name:val*

Return truthy if name contains val48

name:"*val48*"

Range Expressions

Range expressions allow you to search for values within a specific range.

Return truthy if amount is between 10 and 20 included.

amount:[10 TO 20]

Return truthy if amount is between 10 and 20 excluded.

amount:{10 TO 20}

Unary Operators

Unary operators are used to negate conditions:

NOT: Exclude results that match the condition.
- : Exclude results that match the condition.

Truthy if amount is NOT between 10 and 20.

-amount:[10 TO 20]

Truthy if name is NOT equals to myName string.

name:-"myName"

For more complex case with parenthesis, the keyword NOT must be used

Truthy if name equals myName OR if amount equals 100 AND name equals myOtherName

name:"myName" OR NOT (amount:=100 AND name:"myOtherName")

Error Handling

The API provides detailed error messages to help you troubleshoot query issues. Here are some common error scenarios:

Syntax Error: If the query syntax is invalid, you will receive a 400 Bad Request error with a message indicating the issue.

Field Validation Error: If the query references an invalid field or uses an incorrect data type, you will receive a 400 Bad Request error.

Complexity Error: If the query exceeds the maximum allowed complexity (e.g., too many nested expressions or logical operators), you will receive a 400 Bad Request error.

Example Error Response:

{
"status": 400,
"message": "Query has exceeded the maximum allowed depth"
}

Some query example

Truthy if buyer.siren ends by 123456789 OR if seller.siren ends by 88888

buyer.siren:"*123456789" OR seller.siren:"*88888"

Truthy if createdDate is between 2024-01-01 04:05:06 AND 2025-01-01 04:05:06

createdDate:>"2024-01-01 04:05:06" AND createdDate:<"2025-01-01 04:05:06"

Truthy if buyer.siren start by 123456789 AND buyer.corporateName equals iopole OR seller.corporateName equals myOtherCompany AND createdDate is between 2024-01-01 04:05:06 AND 2025-01-01 04:05:06

buyer.siren:"*123456789" AND (buyer.corporateName:iopole OR seller.corporateName:"myOtherCompany") AND createdDate:>="2024-01-01" AND createdDate:<="2025-01-01")'