You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by EbSolutions EbSolutions <eb...@gmail.com> on 2016/09/04 10:37:09 UTC

Function query. Not in range

Hi,
I'm using function query to query on range using sum function.
{!frange l=0 u=100} sum(Field1,Ffield2)

this is working well. However, I'm not able to have the document not in the
range. I've tested
NOT({!frange l=0 u=100} sum(Field1,Ffield2)) but it's not working.

Do you have any idea to do it.

Regards,
NKI.

Re: Function query. Not in range

Posted by EbSolutions EbSolutions <eb...@gmail.com>.
Hi Emir,

Working fine.

Thanks.

Regards,
NKI.


2016-09-05 10:39 GMT+02:00 Emir Arnautovic <em...@sematext.com>:

> Hi NKI,
>
> You'll have to negate range or negate - in case you expect only positive
> values than it would be {!frange l=100} and if you want to include negative
> results, you will have to use
>
> {!frange l=1}or(query($q1),query($q2))&q1={!frange u=0}sum(Field1,
> Ffield2)&q2={!frange l=100}sum(Field1, Ffield2)
>
> or
>
> {!frange l=1}not(query($q1))&q1={!frange l=0 u=100}sum(Field1, Ffield2)
>
>
> HTH,
> Emir
>
>
> On 04.09.2016 12:37, EbSolutions EbSolutions wrote:
>
>> Hi,
>> I'm using function query to query on range using sum function.
>> {!frange l=0 u=100} sum(Field1,Ffield2)
>>
>> this is working well. However, I'm not able to have the document not in
>> the
>> range. I've tested
>> NOT({!frange l=0 u=100} sum(Field1,Ffield2)) but it's not working.
>>
>> Do you have any idea to do it.
>>
>> Regards,
>> NKI.
>>
>>
> --
> Monitoring * Alerting * Anomaly Detection * Centralized Log Management
> Solr & Elasticsearch Support * http://sematext.com/
>
>

Re: Function query. Not in range

Posted by Emir Arnautovic <em...@sematext.com>.
Hi NKI,

You'll have to negate range or negate - in case you expect only positive 
values than it would be {!frange l=100} and if you want to include 
negative results, you will have to use

{!frange l=1}or(query($q1),query($q2))&q1={!frange u=0}sum(Field1, 
Ffield2)&q2={!frange l=100}sum(Field1, Ffield2)

or

{!frange l=1}not(query($q1))&q1={!frange l=0 u=100}sum(Field1, Ffield2)


HTH,
Emir

On 04.09.2016 12:37, EbSolutions EbSolutions wrote:
> Hi,
> I'm using function query to query on range using sum function.
> {!frange l=0 u=100} sum(Field1,Ffield2)
>
> this is working well. However, I'm not able to have the document not in the
> range. I've tested
> NOT({!frange l=0 u=100} sum(Field1,Ffield2)) but it's not working.
>
> Do you have any idea to do it.
>
> Regards,
> NKI.
>

-- 
Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr & Elasticsearch Support * http://sematext.com/