要求:是落實使用DSE搜索面搜索無法得到一個Solr的CQL查詢文檔和方面在DSE搜索
問題:無法獲取文檔或數據和方面在一個CQL solr查詢。
工具&採用技術: Datastax沙盒5.1(美分OS +虛擬盒),並試圖DSE搜索
創建以下使用dsetool使Solr的表&(DSE搜索):
CREATE TABLE test.employee_copy1 (
empid int,
deptid int,
name text,
solr_query text, -- column got created by enabling DSE Search
PRIMARY KEY (empid, deptid)
)
插入以下數據,
INSERT INTO employee (empid,deptid,name) VALUES (100,200,'John');
INSERT INTO employee (empid,deptid,name) VALUES (101,201,'Helen');
INSERT INTO employee (empid,deptid,name) VALUES (102,201,'John');
我試圖面查詢從Solr管理如下
http://localhost:8983/solr/test.employee/select?q=*:*&wt=json&indent=true&facet=true&facet.field=name
得到同時含有文檔(或數據)和小面的結果如預期,
{
"responseHeader": {
"status": 0,
"QTime": 1
},
"response": {
"numFound": 3,
"start": 0,
"docs": [{
"_uniqueKey": "[\"100\",\"200\"]",
"empid": 100,
"deptid": 200,
"name": "John"
},
{
"_uniqueKey": "[\"101\",\"201\"]",
"empid": 101,
"deptid": 201,
"name": "Helen"
},
{
"_uniqueKey": "[\"102\",\"201\"]",
"empid": 102,
"deptid": 201,
"name": "John"
}
]
},
"facet_counts": {
"facet_queries": {},
"facet_fields": {
"name": [
"john", 2,
"helen", 1
]
},
"facet_dates": {},
"facet_ranges": {},
"facet_intervals": {}
}
}
但是,當試圖下面的查詢(CQL)在Datastax devcenter期待看到數據方面,我只看到微面
select JSON * from test.employee where solr_query = '{"q":"*:*", "facet" : {"field":"name"}}';
得到了結果,但它爲O NLY方面,並沒有數據:
{"facet_fields" : {"name" : {"john" : 2,"helen" : 1 } } }
問題:任何人都可以解釋爲什麼CQL查詢不,儘管規定"q":"*:*"
的返回數據?
謝謝。您已經提到它在DSE 5.1中不可行,是否有任何其他版本支持獲取文檔和方面? 另外,你能指點我還是教育我這個限制背後的技術原因是什麼? –
我已經更新了我的回覆,澄清了從5.1開始,沒有支持DSE的版本。 –
在技術上做這件事並不是不可能的,但是這裏的一個問題是將兩個方面的結果和文檔結果放在具有相同列標題的單個基於行的結果中的尷尬處境。 –