Aha.  I think the problem here is the assumption that .toString() on Lucene
query will give you a string that can then be re-parsed in the proper query
and that is currently not the case.  But if you start with the raw query
like the one you would use with the Lucene QP, you should be fine.

Can you replace:

new  SolrQuery(luceneQuery.toString());

with:

new  SolrQuery(Your Raw Query String Here)


Otis
--
Solr & ElasticSearch Support
http://sematext.com/





On Wed, Jan 9, 2013 at 12:33 PM, Jagdish Nomula <jagd...@simplyhired.com>wrote:

> Thanks Otis and Jack for your responses.
>
> We are trying to use embeddedsolr server with a solr query as follows:
>
> EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, "");
>         SolrQuery solrQuery = new  SolrQuery(luceneQuery.toString()); //
> Here luceneQuery is a dismax query with additional filters
> QueryResponse rsp = server.query(solrQuery);
>
> The toString method does not give us good results and
> server.query(solrQuery) fails.
>
> As otis has suggested, we are going to take a look at LuceneQueryParser
> more closely.
>
> Thanks,
>
> Jagdish
>
> On Tue, Jan 8, 2013 at 9:41 PM, Jack Krupansky <j...@basetechnology.com
> >wrote:
>
> > How complex? Does it use any of the more advanced Query Types or detailed
> > options that are not supported in the Solr query syntax?
> >
> > What specific problems did you have.
> >
> > -- Jack Krupansky
> >
> > -----Original Message----- From: Jagdish Nomula
> > Sent: Tuesday, January 08, 2013 9:13 PM
> > To: solr-user@lucene.apache.org
> > Subject: Convert Complex Lucene Query to SolrQuery
> >
> >
> > Hello Solr Users,
> >
> > I am trying to convert a complex lucene query to solrquery to use it
> > in a embeddedsolrserver instance.
> >
> > I have tried the regular toString method without success. Is there any
> > suggested method to do this ?.
> >
> > Greatly appreciate the response.
> >
> >
> > Thanks,
> >
> >
> >
> >
> > --
> > Jagadish Nomula - Senior Manager Search
> > Simply Hired, Inc.
> > 370 San Aleso Ave, Ste. 200
> > Sunnyvale, CA 94085
> >
> > simplyhired.com
> >
>
>
>
> --
> *Jagadish Nomula - Senior Manager Search*
> *Simply Hired, Inc.*
> 370 San Aleso Ave, Ste. 200
> Sunnyvale, CA 94085
>
> simplyhired.com
>

Reply via email to