Text Filtering

You can search for resources based on their text fields in a similar way.

This example searches for all Sites where the name is "My Site".

List Sites > Which have name "My Site"

/api/projects/sites/?name=My Site

But when searching for text in resources, you likely will want to use partial text searches. For this you can add a lookup like contains.

Here, we search for all Sites where the Site name contains the word "School":

List Sites > Which contain the text "School" in their name

/api/projects/sites/?name__contains=School

The contains lookup gets appended to the end of the field name with a double-underscore.

Double Underscores

Double underscores (__) get used in many of the following examples to separate field names from lookups and each other.

Pay close attention to how they are used to get a feel for how you can invent your own filters to perform powerful searches within the API.