Solr query examples
Search for document with id=GB18030TEST
http://localhost:8983/solr/collection1/select?q=id:GB18030TEST
Search for document with id=GB18030TEST AND inStock=true
http://localhost:8983/solr/collection1/select?q=id:GB18030TEST+AND+inStock:true
Search for document with id=GB18030TEST OR inStock=true
http://localhost:8983/solr/collection1/select?q=id:GB18030TEST+OR+inStock:true
Search for all document, filter the result to return documents with inStock=true and price is less than 300. The fq parameters can be added to the q to get the same result, but fq can be cached and it will be faster if the same fq parameters are requested again. fq can also be set in the requestHandler in the solrconfig.xml and it will be appended to all incoming queries that uses this requestHandler.
http://localhost:8983/solr/collection1/select?q=*&fq=inStock:true+AND+price:[*+TO+300]
Search for everything and return the id, name and price of each document.
http://localhost:8983/solr/collection1/select?q=*:*&fl=id,name,price
Facet search with facet field of cat and price from 0 to 100, 100 to 200 and 200 up.
http://localhost:8983/solr/collection1/select?q=*:*&fl=id,name,price&facet=true&facet.field=cat&facet.query=price:[*+TO+100]&facet.query=price:[100+TO+200]&facet.query=price:[200+TO+*]
Search within Codexpedia
Search the entire web