Re: Getting Lucense Query from Solr query (Or converting Solr Query to Lucense's query)

2013-02-06 Thread Sabeer Hussain
It is working but I come across another problem. I am expecting same parsedquery in the following two approaches but I am not getting it as same Approach 1: BooleanQuery myQuery = new BooleanQuery(); myQuery.add(new TermQuery(new Term(PATIENT_GENDER, Male)),

Re: Getting Lucense Query from Solr query (Or converting Solr Query to Lucense's query)

2013-02-04 Thread Sabeer Hussain
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= before sending the request to Solr Server using one of the two approaches 1) Using SolrServer SolrServer server =

Re: Getting Lucense Query from Solr query (Or converting Solr Query to Lucense's query)

2013-02-04 Thread Roman Chyla
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 =

Getting Lucense Query from Solr query (Or converting Solr Query to Lucense's query)

2013-01-07 Thread Sabeer Hussain
Is there a way to get Lucene's query from Solr query?. I have a requirement to search for terms in multiple heterogeneous indices. Presently, I am using the following approach try { Directory directory1 = FSDirectory.open(new

Re: Getting Lucense Query from Solr query (Or converting Solr Query to Lucense's query)

2013-01-07 Thread Roman Chyla
if you are inside solr, as it seems to be the case, you can do this QParserPlugin qplug = req.getCore().getQueryPlugin(LuceneQParserPlugin.NAME); QParser parser = qplug.createParser(PATIENT_GENDER:Male OR STUDY_DIVISION:\Cancer Center\, null, req.getParams(), req); Query q = parser.parse();