Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The "FAQ" page has been changed by HossMan: http://wiki.apache.org/solr/FAQ?action=diff&rev1=85&rev2=86 Comment: multiple people asking why body:* is a slow query == Is there a limit on the number of keywords for a Solr query? == No. If you make a GET query, through [[http://localhost:8080/solr/admin/form.jsp|Solr Web interface]] for example, you are limited to the maximum URL lenght of the browser. + == How can I efficently search for all documents that contain a value in fieldX ? == + + If the number of unique terms in fieldX is bounded and relatively small (ie: a "category" or "state" field) or if fieldX is a "Trie" Numeric field with a small precision step then you will probably find it fast enough to do a simple range query on the field -- ie: `fieldX:[* TO *]`. When possible, doing these in cached filter queries (ie: "fq") will also improve performance. + + A more efficient method is to also ensure that your index has an additional field which records wether or not each document has a value -- ie: `has_fieldX` as a boolean field that can be queried with `has_fieldX:true`, or `num_values_fieldX` that can be queried with `num_values_fieldX:[1 TO *]`. This technique requires you to know in advance that you will want to query on this type of information, so that you can add this extra field to your index, but it can be significantly faster. + + Adding a field like `num_values_fieldX` is extremely easy to do automaticly in [[Solr4.0]] by modifying your `<updateRequestProcessorChain>` to include the `CountFieldValuesUpdateProcessorFactory` + + = Performance =