繁体   English   中英

如何使用 DSE 搜索 6.8 创建搜索索引

[英]How to create search index with DSE search 6.8

我已经使用 Datastax 6.7 几个月了。 使用经典图创建搜索索引需要您创建 schema.xml 和 Solrconfig.xml 到 solr 管理员,这工作正常。 但是当我升级到 DSE 6.8 时,我需要使用 Datastax Studio 6.8 创建搜索索引。 我已经能够创建 VertexLabels、materializedView 和 secondaryIndex。 但我无法创建搜索索引。

这是我创建搜索索引的代码,

  schema.vertexLabel('location').
  searchIndex().
  ifNotExists().
  by('geo_point').
  waitForIndex(3000).
  create()

这是我得到的错误,

java.lang.IllegalStateException: Could not create search index for vertex label 'location' in graph 'food_cql'. RELOAD or REBUILD failed for search index on 'food_cql.location'. Failed to reload search index food_cql.location because: No resource solrconfig.xml for core food_cql.location, did you miss to upload it?

我已经能够使用这些命令成功创建图形核心和搜索索引。

CREATE KEYSPACE IF NOT EXISTS geo WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 2};

CREATE TABLE IF NOT EXISTS geo.states (
state text,
fips int,
pop  int,
geo   text,
solr_query text,
PRIMARY KEY (state)
)WITH VERTEX LABEL states_label;

您需要在搜索节点上指定架构和 Solr 配置文件,如下所示:

dsetool create_core ks_name.table_name schema=/path/to/schema.xml solrconfig=/path/to/solrconfig.xml

您可以运行这些命令来检查它们是否已上传:

dsetool get_core_schema

dsetool get_core_config

您可以运行此命令来检查内核的状态:

dsetool core_indexing_status -all

插入数据,

INSERT INTO geo.states (state, fips, geo, pop) VALUES ('Idahonew',60, 'POLYGON ((-116.04751 49.000239, -116.04751 47.976051, -115.724371 47.696727))', 3594);

像这样运行您的查询来测试:

select * FROM geo.states

g.V().hasLabel('states_label')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM