solr查询非空值

solr查询非空值的方法

q=FieldName:['' TO *]

相当于在sql中执行:

SELECT field_name FROM some_table WHERE field_name IS NOT NULL;

查询某列大于0的记录

q=FieldName:[1 TO *]

对应的sql:

SELECT field_name FROM some_table WHERE field_name > 0;

发表评论

电子邮件地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.