Open nigeljohnson73 opened 8 years ago
If you read that page further down, you will see that CONTAINS
is not for strings. It is for array-like sets and is synonymous with =
queries.
Comparators are either equivalence comparators: =, IN, CONTAINS,...
I didn't read that bit that way, sorry. Someone did point me at adding some form of filtering to do "like" styled queries with the full-text-search, but it seems that has not made the PHP API yet. I think there is also a significant overhead with this in both index storage requirements and processing, so probably not a good thing to add to to a cloud project.
I think "contains" would still be a good enhancement for "tag" style fields?
You can just use =
For example, if you have a multi-value property (string list) called tags, you can do
SELECT * FROM Books WHERE tags = @tag
and then bind a string like Horror
to this, and it will get you any booked tagged as Horror
How can I define a string list field? Do you mean =
equals contains
and if I have a tags
of Horror, Comedy
the query would find it too?
It seems to be supported in the google docs:
https://cloud.google.com/datastore/docs/apis/gql/gql_reference#grammar
Extremely helpful for doing "like" searches.