记录不会被索引到Solr的,如果它有一个地图列未偶数索引
问题描述:
我有有型冷冻<地图<文字,文字>>的列DSE卡桑德拉表。当我尝试在DSE Search Solr中索引表格时,我没有索引上面的Map列。有NULL的记录冻结<地图< text,text>索引在Solr中,而带有VALUE的索引没有被索引。记录不会被索引到Solr的,如果它有一个地图列未偶数索引
根据DSE搜索文档,Indexing frozen maps is not supported。
但是,我根本没有索引冻结列(请参阅下面的schema.xml)。它就在C *表中。
下面是重现该问题的步骤,
创建KEYSPACE
cqlsh> CREATE KEYSPACE arun
WITH REPLICATION = {
'class' : 'SimpleStrategy',
'replication_factor' : 1 };
cqlsh> use arun
创建卡桑德拉表
cqlsh:arun> create table employee (
emp_id int,
emp_name string,
emp_dept string,
emp_dob string,
unique_identifier frozen<map<text, text>>,
primary key (emp_id, emp_name));
创建Solr的核心
$./dsetool create_core arun.employee generateResources=true coreOptionsInline=include_columns:emp_id,emp_name,emp_dept
自动生成:schema.xml中
<schema name="autoSolrSchema" version="1.5">
<types>
<fieldType class="org.apache.solr.schema.TrieIntField" name="TrieIntField"/>
<fieldType class="org.apache.solr.schema.TextField" name="TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<fieldType class="org.apache.solr.schema.StrField" name="StrField"/>
</types>
<fields>
<field docValues="true" indexed="true" multiValued="false" name="emp_id" stored="true" type="TrieIntField"/>
<field indexed="true" multiValued="false" name="emp_dept" stored="true" type="TextField"/>
<field indexed="true" multiValued="false" name="emp_name" stored="true" type="StrField"/>
</fields>
<uniqueKey>(emp_id,emp_name)</uniqueKey>
</schema>
插入的记录到卡桑德拉表
cqlsh> insert into arun.employee
(emp_id, emp_name, emp_dept, emp_dob) values
(1,'arun chan','et','19790101',
{'emp_dept': 'et', 'emp_id': '1', 'emp_name': 'arun chan'});
cqlsh> insert into arun.employee
(emp_id, emp_name, emp_dept, emp_dob) values
(2,'mritula chan','ml','19840101');
cqlsh> insert into arun.employee
(emp_id, emp_name, emp_dept, emp_dob, unique_identifier) values
(3,'jaya guru','ph','19870101',
{'emp_id' : '3', 'emp_name' : 'jaya guru', 'emp_dept' : 'ph'});
卡桑德拉查询:返回3行插入
cqlsh> select * from arun.employee;
emp_id | emp_name | emp_dept | emp_dob | solr_query | unique_identifier
--------+--------------+----------+----------+------------+------------------------------------------------------------
1 | arun chan | et | 19790101 | null | {'emp_dept': 'et', 'emp_id': '1', 'emp_name': 'arun chan'}
2 | mritula chan | ml | 19840101 | null | null
3 | jaya guru | ph | 19870101 | null | {'emp_dept': 'ph', 'emp_id': '3', 'emp_name': 'jaya guru'}
(3 rows)
问题:为什么DSE Solr的查询只返回一个?
cqlsh> select json * from arun.employee where solr_query = '{"q":"*:*"}';
[json]
-----------------------------------------------------------------------------------------------------------------------------------
{"emp_id": 2, "emp_name": "mritula chan", "emp_dept": "ml", "emp_dob": "19840101", "solr_query": null, "unique_identifier": null}
(1 rows)
答
Datastax支持说,这是一个已知的问题。
这里是他们的内部缺陷跟踪号,
DSP-13997:非索引冷冻地图默默的示数