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

The text used to search an index.

Usage notes

  • Empty queries match all records in your index, ordered by customRanking.
  • Queries can be up to 512 bytes.
  • You can’t use boolean operations like AND or OR in queries. But you can combine queries with filters, where you can use boolean operations.

Examples

Search for “shirt”

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

Return all records

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