从 solr api 和 datastax 中检索文档
Retrieve documents from solr api and datastax
我有一个与在 Datastax 上创建的 table 相关的 solr 架构。我知道 datastax 包含整个文档,所以我创建了 solr 模式而不在其上存储字段,只有存储的字段是 ID 字段。
我们使用 CQL 使用 "solr_query" 从 datastax 中检索文档。但是,如果字段未存储,我可以直接从 solr API 检索文档吗?
更新 1
//创建键空间
创建密钥空间 mykeyspace WITH REPLICATION = { 'class' :'NetworkTopologyStrategy', 'Cassandra' : 3, 'Solr' : 2 };
//创建table
创建table我的table(
id uuid
,名称文字
,描述文字
,主键(id,name)
);
//模式字段
<field name="id" type="uuid" indexed="true" stored="true" multiValued="false" omitNorms="true" termVectors="true" termPositions="true" termOffsets="true" />
<field name="name" type="text_general" indexed="true" stored="false" multiValued="false" omitNorms="true" termVectors="true" termPositions="true" termOffsets="true" />
<field name="description" type="text_general" indexed="true" stored="false" multiValued="false" omitNorms="true" termVectors="true" termPositions="true" termOffsets="true" />
//上传配置到solr的命令
curl localhost:8983/solr/resource/mykeyspace.mytable/solrconfig.xml --data-binary @solrconfig.xml -H 'Content-type:text/xml; charset=utf-8'
curl localhost:8983/solr/resource/mykeyspace.mytable/schema.xml --data-binary @schema.xml -H 'Content-type:text/xml; charset=utf-8'
//创建集合
卷曲"localhost:8983/solr/admin/cores?action=CREATE&name=mykeyspace.mytable"
We used CQL to retrieve the documents from datastax using "solr_query". But can I retrieve the documents from solr API directly in case of the fields are not stored?
DSE 搜索始终在 Cassandra 中存储 column/field 值,而不管模式 stored
属性如何(记录有一些例外),因此您的问题的答案是肯定的,您可以使用检索文档CQL 和 HTTP Solr API,但请记住,大多数时候应该首选前者,因为前者速度更快。
我已将字段更改为已存储并使用默认的“/select”处理程序
我有一个与在 Datastax 上创建的 table 相关的 solr 架构。我知道 datastax 包含整个文档,所以我创建了 solr 模式而不在其上存储字段,只有存储的字段是 ID 字段。
我们使用 CQL 使用 "solr_query" 从 datastax 中检索文档。但是,如果字段未存储,我可以直接从 solr API 检索文档吗?
更新 1
//创建键空间
创建密钥空间 mykeyspace WITH REPLICATION = { 'class' :'NetworkTopologyStrategy', 'Cassandra' : 3, 'Solr' : 2 };
//创建table
创建table我的table( id uuid ,名称文字 ,描述文字 ,主键(id,name) );
//模式字段
<field name="id" type="uuid" indexed="true" stored="true" multiValued="false" omitNorms="true" termVectors="true" termPositions="true" termOffsets="true" />
<field name="name" type="text_general" indexed="true" stored="false" multiValued="false" omitNorms="true" termVectors="true" termPositions="true" termOffsets="true" />
<field name="description" type="text_general" indexed="true" stored="false" multiValued="false" omitNorms="true" termVectors="true" termPositions="true" termOffsets="true" />
//上传配置到solr的命令
curl localhost:8983/solr/resource/mykeyspace.mytable/solrconfig.xml --data-binary @solrconfig.xml -H 'Content-type:text/xml; charset=utf-8'
curl localhost:8983/solr/resource/mykeyspace.mytable/schema.xml --data-binary @schema.xml -H 'Content-type:text/xml; charset=utf-8'
//创建集合
卷曲"localhost:8983/solr/admin/cores?action=CREATE&name=mykeyspace.mytable"
We used CQL to retrieve the documents from datastax using "solr_query". But can I retrieve the documents from solr API directly in case of the fields are not stored?
DSE 搜索始终在 Cassandra 中存储 column/field 值,而不管模式 stored
属性如何(记录有一些例外),因此您的问题的答案是肯定的,您可以使用检索文档CQL 和 HTTP Solr API,但请记住,大多数时候应该首选前者,因为前者速度更快。
我已将字段更改为已存储并使用默认的“/select”处理程序