| | 1389 | For faster and/or more restrictive searches, prefix the field name |
| | 1390 | with an operator: |
| | 1391 | |
| | 1392 | `^` |
| | 1393 | Matches the beginning of the field. For example, if |
| | 1394 | ``search_fields`` is set to ``['^first_name', '^last_name']`` and |
| | 1395 | a user searches for ``john lennon``, Django will do the equivalent |
| | 1396 | of this SQL ``WHERE`` clause:: |
| | 1397 | |
| | 1398 | WHERE (first_name ILIKE 'john%' OR last_name ILIKE 'john%') |
| | 1399 | AND (first_name ILIKE 'lennon%' OR last_name ILIKE 'lennon%') |
| | 1400 | |
| | 1401 | `=` |
| | 1402 | Matches exactly, case-insensitive. For example, if |
| | 1403 | ``search_fields`` is set to ``['=first_name', '=last_name']`` and |
| | 1404 | a user searches for ``john lennon``, Django will do the equivalent |
| | 1405 | of this SQL ``WHERE`` clause:: |
| | 1406 | |
| | 1407 | WHERE (first_name ILIKE 'john' OR last_name ILIKE 'john') |
| | 1408 | AND (first_name ILIKE 'lennon' OR last_name ILIKE 'lennon') |
| | 1409 | |
| | 1410 | `@` |
| | 1411 | Performs a full-text match. This is like the default search but |
| | 1412 | uses an index. Currently this is only available for MySQL. |
| | 1413 | |