On this page:

5.9Search Parameter Features


This page outlines optional features that can be enabled or disabled for optimizing how searching works on your server.

Note that every search feature that is enabled comes with a cost in terms of the amount of space that indexes consume, the time it takes to write new data, etc. We have tried to provide sensible defaults but it always makes sense to review these settings and optimize as much as possible.

5.9.1Index Missing Search Parameters (:missing)


This feature defaults to: Disabled

When enabled, the :missing modifier can be used on a SearchParameter to find resources where that search parameter has found (or not found) any data in the given resource.

For example, take the Patient:birthdate search parameter, which indexes the value of Patient.birthDate. The following URL finds all patients having a birthdate: https://try.smilecdr.com/baseR4/Patient?birthdate:missing=false

The following URL finds all patients who do not have a birthdate: https://try.smilecdr.com/baseR4/Patient?birthdate:missing=true

Indexing for missing search parameters can add a great deal of extra index space, and slow down write operations on servers with many enabled search parameters. This feature is therefore disabled by default and must be specifically enabled if it is needed.

5.9.2Index Text on Tokens (:text)


This feature defaults to: Enabled

SearchParameters of type token are generally used to index identifiers and coded fields. For example, a FHIR Body Height Observation can be found using its LOINC code by using the following query: https://try.smilecdr.com/baseR4/Observation?code=http://loinc.org|8302-2

By default, it is also possible to search by the display name of the code ("body height") using the following query: https://try.smilecdr.com/baseR4/Observation?code:text=body+height

This can be helpful if you are building a system that allows such free-text searching, but this can also consume a large amount of extra index space on servers with large numbers of coded fields because a string index is required for every token index. Servers with large numbers of Observations are particularly prone to "index bloat" if token-text indexing is enabled.

Token text indexing can be disabled globally using the Supress String Indexing in Tokens setting on the FHIR Storage module configuration.

It can also be disabled for an individual search parameter using an extension on the search parameter:

  "resourceType": "SearchParameter",
  "id": "observation-code",
  "extension": [ {
    "url": "http://hapifhir.io/fhir/StructureDefinition/searchparameter-token-suppress-text-index",
    "valueBoolean": true
  } ],
  "status": "active",
  "code": "code",
  "base": [ "Observation" ],
  "type": "token",
  "expression": "Observation.code"

It is also possible to enable token text indexing only for specific search parameters by setting the Supress String Indexing in Tokens setting, and then using the extension shown above on specific SearchParameter resources using a value of false.