lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Bickerstaff <j...@johnbickerstaff.com>
Subject Re: Query formulation help
Date Wed, 26 Oct 2016 15:42:09 GMT
Ahh - I see what you're after (I think)

This page should be helpful for you:

https://cwiki.apache.org/confluence/display/solr/Function+Queries

again, I'd try using the Admin UI as a test phase to get things right (and
see the syntax in the URL that comes back on the response)

Open the edismax section of the Admin UI to find fields that you can use to
enter function queries and things like this...

In the case of X + Y, you're probably interested in the "sum" function

HTH...

On Wed, Oct 26, 2016 at 9:28 AM, Shawn Heisey <apache@elyograg.org> wrote:

> On 10/26/2016 9:00 AM, Prasanna S. Dhakephalkar wrote:
> > Hi, Thanks for reply, I did "q": "cost:[20000 TO (20000+5000)]"
>
> Solr doesn't support doing math in that way in a query, except with
> dates.  It's invalid syntax for a range query.  Tom's reply was correct,
> but was phrased in a way that makes a potential promise that Solr won't
> deliver.
>
> https://cwiki.apache.org/confluence/display/solr/Working+with+Dates#
> WorkingwithDates-DateMath
>
> There might be a way to somehow use function query to do it, but if it's
> possible, I do not know how to write it.  If it's even possible, the
> syntax probably would not be straightforward.
>
> The way I would do your query is to have my code do the calculation and
> use 25000 directly instead of 20000+5000.
>
> Thanks,
> Shawn
>
>

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