Suren Raju
Suren Raju

Reputation: 3070

How to access Aache SOLR custom request handler /suggest from solrj or spring data for solr?

I'm new to Solr. I'm implementing auto complete functionality for my application. I have configured the required fields in solr and created a custom request handler /suggest. I'm finding it tricky to access it via solr java client solrj. I'm even fine with the spring data for solr. Please somebody help to access my custom request handler from solr java client.

Upvotes: 0

Views: 657

Answers (2)

Christoph Strobl
Christoph Strobl

Reputation: 6736

With spring-data-solr you might add @Query(requestHandler = "/suggest") or use query.setRequestHandler("/suggest"). In case you're doing autocomplete you might also give /terms and the SimpleTermsQuery a try.

Upvotes: 5

Paige Cook
Paige Cook

Reputation: 22555

SolrJ supports this through the use of the setRequestHandler method on the SolrQuery class.

Upvotes: 2

Related Questions