Re: Using a RequestHandler to expand query parameter
So, the problem I found that's driving this is that I have several phrase synonyms set up. For example, "ipod mini" into "ipad mini". This synonym is only applied if you submit it as a phrase in quotes. So, the pf param doesn't help because it's not the right phrase in the first place. I can fix this by sending in the query as ("ipod mini" ipod mini). -- View this message in context: http://lucene.472066.n3.nabble.com/Using-a-RequestHandler-to-expand-query-parameter-tp4155596p4157637.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Using a RequestHandler to expand query parameter
On 8/28/2014 7:43 AM, jimtronic wrote: > I would like to send only one query to my custom request handler and have the > request handler expand that query into a more complicated query. > > Example: > > */myHandler?q=kids+books* > > ... would turn into a more complicated EDismax query of: > > *"kids books" kids books* > > Is this achievable via a Request Handler definition in solrconfig.xml? As someone else already said, you can write a custom request handler and reference it in a handler definition in your solrconfig.xml file. The sky's the limit for that -- if you can write the code, Solr will use it. This *specific* example that you've given is something that the edismax parser will give you out of the box, when you define the qf and pf parameters. It will automatically search the individual terms you give on the fields in the qf parameter, *and* do a phrase search for all those terms on the fields in the pf parameter. https://cwiki.apache.org/confluence/display/solr/The+Extended+DisMax+Query+Parser http://wiki.apache.org/solr/ExtendedDisMax Thanks, Shawn
Re: Using a RequestHandler to expand query parameter
this is easily doable by a custom (java code) request handler. If you want to avoid writing any java code, you should investigate using https://issues.apache.org/jira/browse/SOLR-5005 (I am myself going to have a look at this interesting feature) On Tue, Sep 9, 2014 at 4:33 PM, jimtronic wrote: > Never got a response on this ... Just looking for the best way to handle > it? > > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Using-a-RequestHandler-to-expand-query-parameter-tp4155596p4157613.html > Sent from the Solr - User mailing list archive at Nabble.com. >
Re: Using a RequestHandler to expand query parameter
Never got a response on this ... Just looking for the best way to handle it? -- View this message in context: http://lucene.472066.n3.nabble.com/Using-a-RequestHandler-to-expand-query-parameter-tp4155596p4157613.html Sent from the Solr - User mailing list archive at Nabble.com.
Using a RequestHandler to expand query parameter
I would like to send only one query to my custom request handler and have the request handler expand that query into a more complicated query. Example: */myHandler?q=kids+books* ... would turn into a more complicated EDismax query of: *"kids books" kids books* Is this achievable via a Request Handler definition in solrconfig.xml? Thanks! Jim -- View this message in context: http://lucene.472066.n3.nabble.com/Using-a-RequestHandler-to-expand-query-parameter-tp4155596.html Sent from the Solr - User mailing list archive at Nabble.com.