I have created a new request handler in Solr name mySearch, in the older versions of Solr I can use the default select request and specify the custom request handler using the "qt" parameter. But in Solr 6.0 that doesn't seem to work.
Is there a way I can invoke the new request handler using a query param instead of solr/mySearch?
In Solr 6, this is controlled by the parameter handleSelect which needs to be set to true and the solrconfig.xml should not have select handler (it does in all examples).
Once you fulfill both conditions, you should be able to get your old behavior to work.
Related
I created the java webhook in past for dialogflow where 1-1 mapping of intent used to be done. Now I am working with actions builder & not getting how to define and build the handlers using Java.
Before #ForIntent was used to map the intents with java methods. Now how should I map the methods with any scene or handlers.
At the moment there isn't a client library or a SDK to use in order to implement a webhook in Java for the Actions Builder.
You have to implement this manually, exposing and endpoint able to receive POST requests with a HandlerRequest object as input param, as specified in this json-schema
Once created your webhook, to select the handler to use you have to check the value under handler.name field of the request and invoke the right handler. To avoid hardcoded if/switch you could use a strategy pattern and reflection/bean loading to invoke the specific handler, using the value achieved by the field handler.name.
So JAX-RS can accept a query param as a list. It does this by flattening fields so that
users/query?from=100&to=200&orderBy=age&orderBy=name
becomes
from: 100
to: 200
orderBy: ["age", "name"]
I'm using AngularJS to make my client side application, How do would I construct this URI string without manually building it?
Using Angular, this is pretty simple. After defining your resource, let's call it MyResource you can have it injected in e.g. a controller the usual way. Then just do
MyResource.query({from: 100, to: 200, more: 'params as you like'}, ...);
With optional callbacks for successful or error response. This obviously also works for other methods on the resource.
Although I didn't try it, I would say you could also use an array of values for a param, like this
MyResource.query({orderBy: ['age', 'name']);
Seems to be in Angular since February 2013.
I have a web application written in Java which uses Struts 1.0. Sometimes when a URL is fired, I can see that it one of the request parameters does not have any name and value like the following ...
http://www.aaa.com/test.do?a=1&b=2&=&d=4&e=5
As can be seen, there is a '&=' which is essentially a parameter with no name and value. I'd like to remove this part from the URL before sending the request to the server. How can I achieve this? Should I use a filter or is there an easier way?
What is the difference between passing query params as /cars/id/toyota vs /cars?id=toyota in a webservice?
Is one REST vs other web service type?
Passing parameter in Rest service in the form of Url or query string, both have different significance.
In simple words
/cars/id/toyota in this toyta is variable and your service expecting something after id/{variablename} otherwise it gives an error (endpoint not found). So in this case your variable became mandatory.
/cars?id=toyota in this case your query string (Id) becomes optional.
So use query string whenever you want to make that variable optional. :)
Nothing, obviously–it all depends on how the consuming service expects to retrieve parameters.
It depends on the receiving party (your web server and the framework you use on that web-service). Both or neither could conceivably be REST web-services, depending on your implementation.
Conceptually, the difference lies in the path from the web-server root (/) and parameters:
/cars/id/toyota is a URL to path /cars/id/toyota without parameters
/cars?id=toyota is a URL to path /cars with parameter named id with value toyota
I have created a request handler in Solr that uses dismax and limits my query to certain fields and adds boosts for relevancy on the "title" field.
This all works fine when I go directly to Solr using an http request in a browser. However my question is whether I can use the request handler if I am accessing Solr using SolrJ?
It would be better if I could control boosts and filters and so on in the request handler rather than having to make code changes but I can't see how to specify a request handler in the API.
Any ideas?
In the class SolrQuery, there is a method setRequestHandler that allows you to do that. You pass the name of the request handler as defined in solrconfig.xml (probably 'dismax').