Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问可以实现字符串属性的模糊查询吗? #258

Closed
htpbackup opened this issue Dec 5, 2018 · 6 comments

Comments

@htpbackup
Copy link

@htpbackup htpbackup commented Dec 5, 2018

类似于SQL的like.
配置文件里hugegraph.properties

search.text_analyzer=ikanalyzer
search.text_analyzer_mode=smart

这是可以对属性值做lucene全文检索吗?查询语句怎么写?

@javeme

This comment has been minimized.

Copy link
Contributor

@javeme javeme commented Dec 5, 2018

可以做contains查询:
比如某人的地址是“北京市海淀区中关村”,可以根据地址的一部分进行搜索这个人:
g.V().hasLabel("person").has("lived", Text.contains("海淀区"))

@oushu1zhangxiangxuan1

This comment has been minimized.

Copy link
Contributor

@oushu1zhangxiangxuan1 oushu1zhangxiangxuan1 commented Feb 27, 2019

Text.contains是不是只支持分词后的全词匹配?可以匹配“海淀区“但是无法匹配“淀区”
或者“He”无法匹配到“Hello Gremlin”?

@javeme

This comment has been minimized.

Copy link
Contributor

@javeme javeme commented Feb 27, 2019

@oushu1zhangxiangxuan1 “Hello Gremlin”为何要使用“He”进行搜索呢?能否描述一下你的需求?

@oushu1zhangxiangxuan1

This comment has been minimized.

Copy link
Contributor

@oushu1zhangxiangxuan1 oushu1zhangxiangxuan1 commented Mar 12, 2019

@javeme Hello的例子可能不太恰当,比如说用 child来搜索"My children"可能会搜索不到,用户可能不一定能拼出全词

@javeme

This comment has been minimized.

Copy link
Contributor

@javeme javeme commented Mar 12, 2019

比如说用 child来搜索"My children"可能会搜索不到,用户可能不一定能拼出全词

@htpbackup 目前hugegraph还无法支持这种搜索,建议上层使用ES等索引库来实现这种模糊查询。

@oushu1zhangxiangxuan1

This comment has been minimized.

Copy link
Contributor

@oushu1zhangxiangxuan1 oushu1zhangxiangxuan1 commented Mar 12, 2019

@javeme 请问有具体支持ES的例子吗?我看了下官方文档好像没有配置外部索引库的配置项.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.