Hi all,. I was working on implementing a custom PostFilter based on Mikhail's response to one of my questions and this looks like a new and *very very* awesome feature that, if no one else does, I plan to blog and talk about at the next meetup if possible (at least my limited understanding of it).
However, in so doing this, I had to read the code and figure out how to get everything to hook up properly which led me to some (mostly design/style) questions: 1) In the SolrIndexSearcher, why are the notCached and postFilter lists of type Query and not ExtendedQuery, likewise for the Comparator. I see a lot of type casting between Query and ExtendedQuery which simply having this be defined using the ExtendedQuery type would solve. Granted there would be a forced casting from ExtendedQuery to Query later in the method but it's tolerable since the method signatures require Query and ExtendedQuery doesn't inherit from Query. 2) In the ExtendedQuery interface, change getCache() to isCached() to keep consistent with the Java beans method naming convention 3) Make "100" a constant in the ExtendedQuery to avoid hardcoding this number and allow for future changes to this notion of "expensive" 4) In the SolrIndexSearcher, it's a bit confusing to me that a "cheap" (cost < 100) PostFilter implementation won't get added to the list of postFilters which made it somewhat misleading as to the reason to implement the PostFilter interface since the delegating collector (the core aspect of this feature) won't get called. What would be the downside to saying if(cost >= 100 OR instanceof PostFilter) then add to postFilters list? As always, I am more than willing to make a patch for any and all of these suggestions but before I go doing that (and thus creating a dependency on a custom built version of Solr as opposed to a standard build), I wanted to ask these first. Thanks! Amit --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
