[英]How to create search index with DSE search 6.8
I have been working with Datastax 6.7 for a couple of months now.我已经使用 Datastax 6.7 几个月了。 Creating search index with the classic graph requires you create schema.xml and Solrconfig.xml through solr admin, which works fine.
使用经典图创建搜索索引需要您创建 schema.xml 和 Solrconfig.xml 到 solr 管理员,这工作正常。 But when i upgraded to DSE 6.8, I need to create the search index using Datastax Studio 6.8.
但是当我升级到 DSE 6.8 时,我需要使用 Datastax Studio 6.8 创建搜索索引。 I have been able to create VertexLabels, materializedView and secondaryIndex.
我已经能够创建 VertexLabels、materializedView 和 secondaryIndex。 But i am unable to create a search index.
但我无法创建搜索索引。
This is my code to create a search index,这是我创建搜索索引的代码,
schema.vertexLabel('location').
searchIndex().
ifNotExists().
by('geo_point').
waitForIndex(3000).
create()
This is the error i get,这是我得到的错误,
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?
I have been able to create a graph core and search index successfully using these commands.我已经能够使用这些命令成功创建图形核心和搜索索引。
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;
you'll need to specify the schema and Solr configuration file like this on a Search node:您需要在搜索节点上指定架构和 Solr 配置文件,如下所示:
dsetool create_core ks_name.table_name schema=/path/to/schema.xml solrconfig=/path/to/solrconfig.xml
You can run these commands to check that they've been uploaded:您可以运行这些命令来检查它们是否已上传:
dsetool get_core_schema
dsetool get_core_config
You can run this command to check the status of the cores:您可以运行此命令来检查内核的状态:
dsetool core_indexing_status -all
Insert data,插入数据,
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);
Run your queries like this to test:像这样运行您的查询来测试:
select * FROM geo.states
g.V().hasLabel('states_label')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.