API Reference / API Parameters / query
Type: string
Engine default: "" (returns all records)
Parameter syntax
$index->search('YourQuery');

Can be used in these methods:

About this parameter

Input text that specifies what should be searched for in the index.

  • Empty queries match all records in your index, ordered by customRanking.
  • Queries can be up to 512 bytes.
  • You can’t use boolean operations (AND, OR, NOT) in queries.
  • Queries with multiple words only match records where all words match. For example, the query “hot dog” is interpreted as “hot” AND “dog” (rather than “hot” OR “dog”). You can relax this requirement if there are no matches with the removeWordsIfNoResults parameter.

Examples

Search for “shirt”

1
$results = $index->search('shirt');

Return all records

1
$results = $index->search('');
Did you find this page helpful?