With _ilike search parameter you search for terms inclusion as substring in text representation of FHIR resource. Interesting feature of this parameter, that it can provide quick feedback to user about matches without forcing she to print the whole word (as with full text search). For example
jo will find Johns and Jolie or
asp will match Aspirin.
That's why it is default search in Aidbox Console user interface.
With _ilike parameter you terms separeted with space combined with
AND and separeted by comma
OR . Example abowe is translated into SQL query like this:
SELECT * FROM patientWHEREresource::text ilike '%joh%' AND ... ilike '%smit%'ORresource::text ilike '%jes%' AND ... '%park%'
ILIKE search can be efficiently indexed with trigram PostgreSQL extension and GIN Index, providing response in tens of miliseconds responses on milions of records.
CREATE INDEX patient_trgm_idx on patientUSING gin ((id || ' ' || resource::text) gin_trgm_ops);VACUUM ANALYZE patient;