我正在使用QuickStart(http://lucene.apache.org/solr/quickstart.html)学习Solr。 但是当我尝试使用像QuickStart这样的facet命令时:
curl http://localhost:8983/solr/collection1/select?wt=json&indent=true&q=*:*&rows=0 \
&facet=true&facet.field=manu_id_s
In your terminal, you'll see:
{
"responseHeader":{
"status":0,
"QTime":3,
"params":{
"facet":"true",
"indent":"true",
"q":"*:*",
"facet.field":"manu_id_s",
"wt":"json",
"rows":"0"}},
"response":{"numFound":2990,"start":0,"docs":[]
},
"facet_counts":{
"facet_queries":{},
"facet_fields":{
"manu_id_s":[
"corsair",3,
"belkin",2,
"canon",2,
"apple",1,
"asus",1,
"ati",1,
"boa",1,
"dell",1,
"eu",1,
"maxtor",1,
"nor",1,
"uk",1,
"viewsonic",1,
"samsung",0]},
"facet_dates":{},
"facet_ranges":{},
"facet_intervals":{}}}
然后我输入命令:
curl http://localhost:8983/solr/collection1/select?wt=json&indent=true&q=*:*&rows=0&facet=true&facet.field=manu_id_s
在终端,但我得到的是:
[1] 1058
[2] 1060
[3] 1061
[4] 1062
[5] 1063
{"responseHeader":{"status":0,"QTime":0,"params":{"wt":"json"}},"response": {"numFound":0,"start":0,"docs":[]}}
facet.field=manu_id_s:command not found
[1] done curl http://localhost:8983/solr/collection1/select?wt=json
[2] done indent=true
[3] done q=*:*
[4]- done rows=0
[5]+ done facet=on
为什么找不到facet命令?
答案 0 :(得分:0)
请试试这个:
curl 'http://localhost:8983/solr/collection1/select?wt=json&indent=true&q=*:*&rows=0&facet=true&facet.field=manu_id_s'
您刚刚错过了网址中的引号:D