开发者

Regarding Boolean logic in Solr

I have a Solr index with a year field, I can query all results within a range of y开发者_如何学Goears using the following query which works fine

*:* AND year:[1934 TO 1950]

How would I incorporate the AND operator so I can search for results in a number of selected years, eg. results for year 1930 AND year 1950 only. I tried something like:

*:* AND year:1934 AND year:1950 

the above query displays no results.


*:* AND (year:1934 OR year:1950)

Your's does not display a result because there can be no match in both years (but that's what what the expression says).


  1. You don't need to get *:* AND year:[1934 TO 1950], just year:[1934 TO 1950] is enough.
  2. Unless year is a multivalued field you probably want year:1934 OR year:1950
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜