Reputation: 4861
I'm coming across a strange situation where I cannot search on string tags that end with a special character. So far I've tried )
and ]
.
For example, given a Fruit index with a record with a tag apple (red)
, if you query (using the JS library) with tagFilters: "apple (red)"
, no results will be returned even if there are records with this tag.
However, if you change the tag to apple (red
(not ending with a special character), results will be returned.
Is this a known issue? Is there a way to get around this?
EDIT
I saw this FAQ on special characters. However, it seems as though even if I set ()
as separator characters to index that only effects the direct attriubtes that are searchable, not the tag. is this correct? can I change the separator characters to index on tags?
Upvotes: 1
Views: 542
Reputation: 12032
You should try using the array syntax for your tags:
tagFilters: ["apple (red)"]
The reason it is currently failing is because of the syntax of tagFilters
. When you pass a string, it tries to parse it using a special syntax, documented here, where commas mean "AND" and parentheses delimit an "OR" group.
By the way, tagFilters
is now deprecated for a much clearer syntax available with the filters
parameter. For your specific example, you'd use it this way:
filters: '_tags:"apple (red)"'
Upvotes: 1