Error in string array filter that has spaces between words

I am trying to query in an array field. When I put a word without spaces it works but when I put a name with space it gives error.

It Works - .setFilters(“cidade:São”)
Does not Works(error) - .setFilters(“cidade:São Paulo”)
ERRO ALGOLIA: com.algolia.search.saas.AlgoliaException: filters: Unexpected token string(Paulo) expected end of filter

How do I resolve this?

My field:
“cidade”: [
“São Paulo”,
“SE”,
“Brasil”
]

Hi there,

It should work if if you use quotes around the filter value. It should look something like this:

setFilters('cidade: "São Paulo"')

You can learn more about this in the docs: https://www.algolia.com/doc/api-reference/api-parameters/filters/#usage-notes

I hope this helps!

Kind regards,
Vincent

Thanks for the help, buddy.