lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Khludnev <mkhlud...@griddynamics.com>
Subject Re: Queries not supported by Lucene Query Parser syntax
Date Fri, 02 Jan 2015 03:04:17 GMT
Hello Leonid,

Yep. This problem exists and makes hard the migration from Lucene to Solr.
You might be interested in Parboiled
http://www.youtube.com/watch?v=DXiRYfFGHJE
The simplest way to solve it is to serialize Lucene Query instance into
parameter or request body. Unfortunately, Query is not Serializable, but
it's possible to do this with non-invasive serializers like XStream. Then,
QParserPlugin can read this param or a body and deserialize Lucene query
instance.
Have a good hack!

On Thu, Jan 1, 2015 at 12:08 PM, Leonid Bolshinsky <leonidbol@gmail.com>
wrote:

> Hello,
>
> Are we always limited by the query parser syntax when passing a query
> string to Solr?
> What about the query elements which are not supported by the syntax?
> For example, BooleanQuery.setMinimumNumberShouldMatch(n) is translated by
> BooleanQuery.toString() into ~n. But this is not a valid query syntax. So
> how can we express this via query syntax in Solr?
>
> And more general question:
> Given a Lucene Query object which was built programatically by a legacy
> code (which is using Lucene and not Solr), is there any way to translate it
> into Solr query (which must be a string). As Query.toString() doesn't have
> to be a valid Lucene query syntax, does it mean that the Solr query string
> must to be manually translated from the Lucene query object? Is there any
> utility that performs this job? And, again, what about queries not
> supported by the query syntax, like CustomScoreQuery, PayloadTermQuery
> etc.? Are we always limited in Solr by the query parser syntax?
>
> Thanks,
> Leonid
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mkhludnev@griddynamics.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message