On 11/14/2014 9:51 AM, henry cleland wrote: > How do I search only a subset of my corpus based on a large list of non > consecutive unique key ids (cannot do a range query). > Is there a way around doing this q=id:(id1 OR id2 OR id3 OR id4 ... OR > id40000 ) AND name:* > > Also what is the limit of "OR"s i can apply on the query if that is the > only way out, i don't suppose it is infinity.
Very large boolean queries can be slow. You might want to use the TermsQuery parser instead: https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-TermsQueryParser For what you are actually trying to do, the number of OR clauses you can have is determined by two things: 1) The maxBooleanClauses value in solrconfig.xml, which defaults to 1024. 2) The size of the query string allowed. 2a) If the request is a GET, the max http header size controls how long your query (and the other URL paramters) can be. This almost always defaults to 8K, or 8192 bytes, and includes other things, like the "GET" command, the URL path, and the protocol (usually HTTP/1.1). This header size is configurable in the servlet container config. 2b) If the request is a POST, the size limit in any recent Solr version for the request will usually be 2MB. That limit is configurable in solrconfig.xml. I'm trying to get the maxBooleanClauses limit removed: https://issues.apache.org/jira/browse/SOLR-4586 Thanks, Shawn