You could use LocalSolrQueryRequest to create the request, but it is not necessary, if all what you need is to get the lucene query parser, just do:
import org.apache.lucene.queryparser.classic.QueryParser qp = new QueryParser(Version.LUCENE_40, defaultField, new SimpleAnalyzer()); Query q = qp.parse(queryString) hth roman On Mon, Feb 4, 2013 at 3:57 AM, Sabeer Hussain <shuss...@del.aithent.com>wrote: > Hi, > Thanks for the reply. In my application, I am using some servlets to > receive > the request from user since I need to authenticate the user and adding > conditions like userid=xxxx before sending the request to Solr Server using > one of the two approaches > > 1) Using SolrServer > SolrServer server = new CommonsHttpSolrServer(.....); > ModifiableSolrParams params = new ModifiableSolrParams(); > params.set(....); > QueryResponse response = server.query(params); > > 2) Using URLConnection > ModifiableSolrParams params = new ModifiableSolrParams(); > params.set(....); > String paramString = params.toString(); > > URL url = new URL("http://localhost:8080/solr/select?"+paramString); > URLConnection connection = null; > try > { > connection = url.openConnection(); > } > catch(Exception e) > { > e.printStackTrace(); > } > > ..... reading the response > > All I am doing is using SolrJ APIs. So, please tell me how I can get > SolrQueryRequest object or anything like that to get the instance of > QParserPlugin. Is it possible to create SolrQueryRequest from > HttpServletRequest? I would like to use SolrJ to create Lucense Query from > Solr query (but I do not know whether it is possible or not) > > > Regards > Sabeer > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Getting-Lucense-Query-from-Solr-query-Or-converting-Solr-Query-to-Lucense-s-query-tp4031187p4038300.html > Sent from the Solr - User mailing list archive at Nabble.com. >