Peuss, Thomas wrote:
Hello!
You might have seen my patch to SOLR-127.
I have a question there: why is Solr using a filter instead of a servlet
to answer search requests? I have seen that it used a servlet before.
Why was that changed to a filter? The speed gains are minimal from my
point of view (at least in Tomcat).
We switched to a filter for flexibility not speed. The
SolrDispatchFilter is applied to /*, so it can _choose_ to handle a
request on any path or pass the request on down the chain.
As a filter, we can configure what paths map to what RequestHandlers in
solrconfig.xml rather then in web.xml
Any reason not to use a filter?