How to query SOLR for empty fields?

user188962 picture user188962 · Nov 21, 2010 · Viewed 110k times · Source

I have a large solr index, and I have noticed some fields are not updated correctly (the index is dynamic).

This has resulted in some fields having an empty "id" field.

I have tried these queries, but they didn't work:

 id:''
 id:NULL
 id:null
 id:""
 id:
 id:['' TO *]

Is there a way to query empty fields?

Thanks

Answer

netcoder picture netcoder · Nov 21, 2010

Try this:

?q=-id:["" TO *]