: Probably I'm also interested in PrefixQueries, as they also provide a : Term, e.g. parsing "ipod AND brand:apple" gives a PrefixQuery for : "brand:apple".
uh? ... it shoudn't, not unless we're talking about some other customization you've already made. : I want to do s.th. like "dynamic faceting" - so that the solr client : does not have to request facets via facet.field, but that I can decide : in my CustomRequestHandler which facets are returned. But I want to : return only facets for fields that are not already constained, e.g. : when the query contains s.th. like "brand:apple" I don't want to return : a facet for the field "brand". Hmmm, i see ... well the easiest way to go is not to worry about it when parsing the query, when you go to compute facets for all hte fields you tink might be useful, you'll see that only one value for "brand" matches, and you can just skip it. that doesn't really work well for range queries -- but you can't exactly use the same logic for picking what your facet contraints will be on a field that makes sense to do a rnage query on anyway, so it's tricky either way. the custom QueryParser is still probably your best bet... : Ok, so I would override getFieldQuery, getPrefixQuery, getRangeQuery and : getWildcardQuery(?) and record the field names? And I would use this : QueryParser for both parsing of the query (q) and the filter queries : (fq)? yep. (Also Note there is also an extractTerms method on Query that can help in some cases, but the impl for ConstantScoreQuery (which is used when the SolrQueryParser sees a range query or a prefix query) doesn't really work at the moment.) -Hoss