Anyofterms doesn't work as expected with Chinese characters

The new release of Dgraph 1.0.11 has improved support for language tokenization. Unfortunately, the handling of these words is not optimal. I’m opening an issue to work on that more.

But in 1.0.11 you can do:

# schema
word: string @index(term) @lang .

# mutate
{set{
   _:x1 name "名字1"@zh .
   _:x2 name "名字2"@zh .
}}

# query
{
   q(func: anyofterms(name@., "<名字1 名字2>")) {
     name@.
   }
}

Try that and see if it works for you.

1 Like