You are adding a "search component", and adding it as a "last-component", meaning, it will come after the Query component which actually does the work.
Given the parameters you have set, you will be using the default Lucene query parser which doesn't honour the qf parameter, so it isn't surprising that the QueryComponent is ignoring qf. What is it that you are trying to do? Upayavira On Mon, May 11, 2015, at 09:33 AM, nutchsolruser wrote: > Hi , > > I am trying to add my own query parameters in Solr query using solr > component . In below example I am trying to add qf parameter in the > query. > Below is my prepare method of component. But Solr is not considering qf > parameter while searching It is using df parameter that I have added in > schema.xml file as default search field. > > > > @Override > public void prepare(ResponseBuilder rb) throws IOException { > LOG.info("called Prepare "); > SolrQueryRequest req = rb.req; > SolrQueryResponse rsp = rb.rsp; > SolrParams params = req.getParams(); > ModifiableSolrParams modifiableSolrParams=new > ModifiableSolrParams(params); > modifiableSolrParams.set("qf", "journal"); > rb.req.setParams(modifiableSolrParams); > QParser parser; > try { > parser = QParser.getParser(rb.getQueryString(), > "edismax", req); > rb.setQparser(parser) ; > } catch (SyntaxError e) { > e.printStackTrace(); > } > LOG.info("Solr Request "+rb.req.toString()); > } > > relevanct request handler in solrconfig.xml file : > <requestHandler name="/custom-api" class="solr.SearchHandler" > > <lst name="defaults"> > <str name="q.alt">*:*</str> > <str name="df">description</str> > </lst> > <arr name="last-components"> > <str>custom-component</str> > </arr> > </requestHandler> > > > How I can add qf param correctly in query so that solr can use this while > searching ? > > > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Solr-custom-component-issue-tp4204799.html > Sent from the Solr - User mailing list archive at Nabble.com.