solrnet

How we changes standard query handler


I am using solrnet I have created a new handler and want to change standard query handler "select" to "new" without using any extra parameter like "qt" or defType.

Currently "http://localhost:8080/solr/select?q=:"

Want "http://localhost:8080/solr/new?q=:"

Please advise me this is possible or not?


Solution

  • The post Changing Handler Endpoint in SolrQueryExecutor in the SolrNet Google Groups states that in order to do this you will need to modify the SolrQueryExecutor as described:

    Question: On our Solr instance we have changed the search endpoint from "/ select" to "/search". I see in SolrQueryExecuter that there is a Handler property that just returns the DefaultHandler of "/select". Is there any way to change this to use my endpoint?

    Answer: That's correct, you need to change that property in SolrQueryExecuter. How you do that depends on your IoC container. For example, with the built-in container you'd Remove() ISolrQueryExecuter and add your own with the changed handler property. This is a quite rare thing to do, usually I just set up different request handlers not as endpoints but as regular names, then you can use the qt parameter to select one.