开发者

Solr range query for specefic id like /solr/select?q=x:[1,2,5,11,64589]

I have some sp开发者_运维百科ecific id like 1,2,5,11,64589 in solr (int type)

I want to qet query like ttp://localhost:8983/solr/select?q=x:[1,2,5,11,64589] but does not work (get error). how can do it ???

Note: i can implement with "OR" but i want simple way (and other problem limit in max url char length)


These are your options:

  • ?q=x:(1 OR 2 OR 5 OR ...)
  • ?q=x:1 OR x:2 OR x:5 OR ...
  • ?q=x:(1 2 5 ...) with defaultOperator="OR" (haven't tried this one but it should work)
  • Write your own RequestHandler
  • Write your own QueryParser


In Solr 4.10 and Heliosearch 0.07, you can use the more efficient terms query:

q={!terms f=id}1,2,5,11,64589
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜