开发者

In Solr, what is the difference between the NOT and - (minus) operators?

In Solr, is there a difference between the NOT and - (minus) operators? If so, what is it?

Solr documentation refere开发者_Go百科nces the Lucene Query Parser Syntax, and it is vague on this matter. The two operators seem to function the same way, but it's not clear.


To expand on Mauricio's answer (because the QueryParser class is some of the most confusing code I've ever read) if you look at lines 145-152 you'll see:

  case MINUS:
    jj_consume_token(MINUS);
             ret = MOD_NOT;
    break;
  case NOT:
    jj_consume_token(NOT);
           ret = MOD_NOT;
    break;

So they are both considered MOD_NOTs.


The Lucene QueryParser code says they're equivalent.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜