【问题标题】:Search capabilities on datastax enterprise graphdatastax 企业图上的搜索功能
【发布时间】:2023-03-23 00:47:02
【问题描述】:
如何在 DSE graph 中实现 DSE search / Solr 支持的搜索能力。 DSE 图支持为字段创建类型为“搜索”的索引,但这是有限的,并且不提供所有搜索引擎功能。我们是否需要有单独的 DSE 搜索实例(需要定义 Cassandra 表)并将数据从 DSE 图移动到 DSE 搜索以启用 DSE 搜索提供的搜索功能?
谢谢
【问题讨论】:
标签:
datastax-enterprise
datastax-enterprise-graph
【解决方案2】:
您应该在 DSE 搜索节点上运行 DSE Graph。当您在图中创建搜索索引时 - 也会创建相应的 solr 核心。所以:
schema.propertyKey('name').Text().create()
schema.propertyKey('favorite_number').Int().create()
schema.propertyKey('favorite_words').Text().create()
schema.propertyKey('a_third_thing').Int().create()
schema.vertexLabel('person').properties('name','favorite_number','favorite_words','a_third_thing').create()
//This last line is the index creation
schema.vertexLabel('person').index('search').search().by('name').asString().by('favorite_number').by('favorite_words').asText().add()
将创建一个包含 name、favorite_number 和 favorite_words 字段的核心(但不是 a_third_thing)。
https://docs.datastax.com/en/latest-dse/datastax_enterprise/graph/using/useSearchIndexes.html