Solr return all results when q=<empty> Solr return all results when q=<empty> codeigniter codeigniter

Solr return all results when q=<empty>


There might be some other solutions available, I can propose you the following 2 solutions.

  1. You can check your input box. If it's empty, by default pass *:* as input with the Solr URL.
  2. Or you can modify your solrconfig.xml for the select request handler. Put

<str name="q.alt">*:*</str>

While querying

http://'localhost':8080/solr/collection1/select?q=&wt=xml&indent=true&defType=dismax

You can see though I've provided q= , but it'll return all the result. Because it'll take the q.alt query as the query parser is Dismax now. For further info please read here