On Thu, 2007-08-23 at 10:44 -0700, Chris Hostetter wrote: > : 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. My fault, this is returned for s.th. like "brand:appl*" - but perhaps I would also like to facet on such fields then...
> > > : 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. I would think that this is not the best option in terms of performance. > > 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. Alright, then I'll choose this door. > > (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.) Yep, I already had tried this, but it always failed with an UnsupportedOperationException... Thanx a lot, cheers, Martin > > -Hoss > -- Martin Grotzke http://www.javakaffee.de/blog/
signature.asc
Description: This is a digitally signed message part