dgraph 中文名字查询不准确或查不到数据问题
使用eq查询,中文查询,无返回值
{
q(func: eq(td.attribute.type, "person"))@filter(eq(td.attribute.name@zh,"可乐")){
uid
expand(_all_)
}
}
英文查询有返回值
{
q(func: eq(td.attribute.type, "person"))@filter(eq(td.attribute.name@zh,"t1")){
uid
expand(_all_)
}
}
使用allofterms,中文英文均可查询
{
q(func: eq(td.attribute.type, "person"))@filter(allofterms(td.attribute.name@zh,"可乐")){
uid
expand(_all_)
}
}
使用anyofterms查询,中文查询数据不准确,英文查询准确
{
q(func: eq(td.attribute.type, "person"))@filter(anyofterms(td.attribute.name@zh,"可乐")){
uid
expand(_all_)
}
}
本文探讨了使用DGraph进行中文名字查询时遇到的问题,包括使用eq查询无法获取结果的情况,而allofterms和anyofterms则分别可以成功查询中文和出现数据不准确的现象。
1340

被折叠的 条评论
为什么被折叠?



