0
我有有型冷凍<地圖<文字,文字>>的列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)