Lucene query to Solr query

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Lucene query to Solr query

gnandre
Hi,

I have a Lucene query as following (toString represenation of Lucene's
Query object):

+(topics:29)^2 (topics:38)^3 +(-id:41135)

It works fine when I am using it as a lucene query in
SolrIndexSearcher.getDocList function.

However, now I want to use it as a Solr query and query against a
collection. I tried to use the as-is representation from Lucene query
object's toString method but it does not work. How should I proceed?
Reply | Threaded
Open this post in threaded view
|

Re: Lucene query to Solr query

Edward Ribeiro
Hi,

A more or less equivalent query (using Solr's LuceneQParser) to
"topics:29^2 AND (-id:41135) topics:38^3" would be:

topics:29^2 AND (-id:41135) topics:38^3

Edward

On Mon, Jan 20, 2020 at 1:10 AM Arnold Bronley <[hidden email]>
wrote:

> Hi,
>
> I have a Lucene query as following (toString represenation of Lucene's
> Query object):
>
> +(topics:29)^2 (topics:38)^3 +(-id:41135)
>
> It works fine when I am using it as a lucene query in
> SolrIndexSearcher.getDocList function.
>
> However, now I want to use it as a Solr query and query against a
> collection. I tried to use the as-is representation from Lucene query
> object's toString method but it does not work. How should I proceed?
>
Reply | Threaded
Open this post in threaded view
|

Re: Lucene query to Solr query

Edward Ribeiro
equivalent to "+(topics:29)^2 (topics:38)^3 +(-id:41135)", I mean. :)

Edward

On Wed, Jan 22, 2020 at 1:51 PM Edward Ribeiro <[hidden email]>
wrote:

> Hi,
>
> A more or less equivalent query (using Solr's LuceneQParser) to
> "topics:29^2 AND (-id:41135) topics:38^3" would be:
>
> topics:29^2 AND (-id:41135) topics:38^3
>
> Edward
>
> On Mon, Jan 20, 2020 at 1:10 AM Arnold Bronley <[hidden email]>
> wrote:
>
>> Hi,
>>
>> I have a Lucene query as following (toString represenation of Lucene's
>> Query object):
>>
>> +(topics:29)^2 (topics:38)^3 +(-id:41135)
>>
>> It works fine when I am using it as a lucene query in
>> SolrIndexSearcher.getDocList function.
>>
>> However, now I want to use it as a Solr query and query against a
>> collection. I tried to use the as-is representation from Lucene query
>> object's toString method but it does not work. How should I proceed?
>>
>