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

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

The Solr documentation refers to Lucene Query Parser Syntax , and this is vague on this. Both operators seem to work the same, but this is not clear.

+3
source share
2 answers

To extend the answer to Mauricio (since the QueryParser class is the most complex code I've ever read), if you look at lines 145-152, you will see:

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

Therefore they are considered MOD_NOTs.

+3
source

Source: https://habr.com/ru/post/1783934/


All Articles