Re: How to set a condition over stats result

2013-10-04 Thread Steven Bower
Check out: https://issues.apache.org/jira/browse/SOLR-5302 can do this
using query facets


On Fri, Jul 12, 2013 at 11:35 AM, Jack Krupansky wrote:

> sum(x, y, z) = x + y + z (sums those specific fields values for the
> current document)
>
> sum(x, y) = x + y (sum of those two specific field values for the current
> document)
>
> sum(x) = field(x) = x (the specific field value for the current document)
>
> The "sum" function in function queries is not an aggregate function. Ditto
> for min and max.
>
> -- Jack Krupansky
>
> -Original Message- From: mihaela olteanu
> Sent: Friday, July 12, 2013 1:44 AM
> To: solr-user@lucene.apache.org
>
> Subject: Re: How to set a condition over stats result
>
> What if you perform sub(sum(myfieldvalue),100) > 0 using frange?
>
>
> __**__
> From: Jack Krupansky 
> To: solr-user@lucene.apache.org
> Sent: Friday, July 12, 2013 7:44 AM
> Subject: Re: How to set a condition over stats result
>
>
> None that I know of, short of writing a custom search component.
> Seriously, you could hack up a copy of the stats component with your own
> logic.
>
> Actually... this may be a case for the new, proposed Script Request
> Handler, which would let you execute a query and then you could do any
> custom JavaScript logic you wanted.
>
> When we get that feature, it might be interesting to implement a variation
> of the standard stats component as a JavaScript script, and then people
> could easily hack it such as in your request. Fascinating.
>
> -- Jack Krupansky
>
> -Original Message- From: Matt Lieber
> Sent: Thursday, July 11, 2013 6:08 PM
> To: solr-user@lucene.apache.org
> Subject: How to set a condition over stats result
>
>
>>  Hello,
>
> I am trying to see how I can test the sum of values of an attribute across
> docs.
> I.e. Whether sum(myfieldvalue)>100 .
>
> I know I can use the stats module which compiles the sum of my attributes
> on a certain facet , but how can I perform a test this result (i.e. Is
> sum>100) within my stats query? From what I read, it's not supported yet
> to perform a function on the stats module..
> Any other way to do this ?
>
> Cheers,
> Matt
>
>
>
>
>
> __**__
>
>
>
>
>
>
> NOTE: This message may contain information that is confidential,
> proprietary, privileged or otherwise protected by law. The message is
> intended solely for the named addressee. If received in error, please
> destroy and notify the sender. Any use of this email is prohibited when
> received in error. Impetus does not represent, warrant and/or guarantee,
> that the integrity of this communication has been maintained nor that the
> communication is free of errors, virus, interception or interference.
>


Re: How to set a condition over stats result

2013-07-12 Thread Jack Krupansky
sum(x, y, z) = x + y + z (sums those specific fields values for the current 
document)


sum(x, y) = x + y (sum of those two specific field values for the current 
document)


sum(x) = field(x) = x (the specific field value for the current document)

The "sum" function in function queries is not an aggregate function. Ditto 
for min and max.


-- Jack Krupansky

-Original Message- 
From: mihaela olteanu

Sent: Friday, July 12, 2013 1:44 AM
To: solr-user@lucene.apache.org
Subject: Re: How to set a condition over stats result

What if you perform sub(sum(myfieldvalue),100) > 0 using frange?



From: Jack Krupansky 
To: solr-user@lucene.apache.org
Sent: Friday, July 12, 2013 7:44 AM
Subject: Re: How to set a condition over stats result


None that I know of, short of writing a custom search component. Seriously, 
you could hack up a copy of the stats component with your own logic.


Actually... this may be a case for the new, proposed Script Request Handler, 
which would let you execute a query and then you could do any custom 
JavaScript logic you wanted.


When we get that feature, it might be interesting to implement a variation 
of the standard stats component as a JavaScript script, and then people 
could easily hack it such as in your request. Fascinating.


-- Jack Krupansky

-Original Message- From: Matt Lieber
Sent: Thursday, July 11, 2013 6:08 PM
To: solr-user@lucene.apache.org
Subject: How to set a condition over stats result




Hello,

I am trying to see how I can test the sum of values of an attribute across
docs.
I.e. Whether sum(myfieldvalue)>100 .

I know I can use the stats module which compiles the sum of my attributes
on a certain facet , but how can I perform a test this result (i.e. Is
sum>100) within my stats query? From what I read, it's not supported yet
to perform a function on the stats module..
Any other way to do this ?

Cheers,
Matt












NOTE: This message may contain information that is confidential, 
proprietary, privileged or otherwise protected by law. The message is 
intended solely for the named addressee. If received in error, please 
destroy and notify the sender. Any use of this email is prohibited when 
received in error. Impetus does not represent, warrant and/or guarantee, 
that the integrity of this communication has been maintained nor that the 
communication is free of errors, virus, interception or interference. 



Re: How to set a condition over stats result

2013-07-11 Thread mihaela olteanu
What if you perform sub(sum(myfieldvalue),100) > 0 using frange?



 From: Jack Krupansky 
To: solr-user@lucene.apache.org 
Sent: Friday, July 12, 2013 7:44 AM
Subject: Re: How to set a condition over stats result
 

None that I know of, short of writing a custom search component. Seriously, you 
could hack up a copy of the stats component with your own logic.

Actually... this may be a case for the new, proposed Script Request Handler, 
which would let you execute a query and then you could do any custom JavaScript 
logic you wanted.

When we get that feature, it might be interesting to implement a variation of 
the standard stats component as a JavaScript script, and then people could 
easily hack it such as in your request. Fascinating.

-- Jack Krupansky

-Original Message- From: Matt Lieber
Sent: Thursday, July 11, 2013 6:08 PM
To: solr-user@lucene.apache.org
Subject: How to set a condition over stats result

> 
Hello,

I am trying to see how I can test the sum of values of an attribute across
docs.
I.e. Whether sum(myfieldvalue)>100 .

I know I can use the stats module which compiles the sum of my attributes
on a certain facet , but how can I perform a test this result (i.e. Is
sum>100) within my stats query? From what I read, it's not supported yet
to perform a function on the stats module..
Any other way to do this ?

Cheers,
Matt












NOTE: This message may contain information that is confidential, proprietary, 
privileged or otherwise protected by law. The message is intended solely for 
the named addressee. If received in error, please destroy and notify the 
sender. Any use of this email is prohibited when received in error. Impetus 
does not represent, warrant and/or guarantee, that the integrity of this 
communication has been maintained nor that the communication is free of errors, 
virus, interception or interference. 

Re: How to set a condition over stats result

2013-07-11 Thread Jack Krupansky
None that I know of, short of writing a custom search component. Seriously, 
you could hack up a copy of the stats component with your own logic.


Actually... this may be a case for the new, proposed Script Request Handler, 
which would let you execute a query and then you could do any custom 
JavaScript logic you wanted.


When we get that feature, it might be interesting to implement a variation 
of the standard stats component as a JavaScript script, and then people 
could easily hack it such as in your request. Fascinating.


-- Jack Krupansky

-Original Message- 
From: Matt Lieber

Sent: Thursday, July 11, 2013 6:08 PM
To: solr-user@lucene.apache.org
Subject: How to set a condition over stats result




Hello,

I am trying to see how I can test the sum of values of an attribute across
docs.
I.e. Whether sum(myfieldvalue)>100 .

I know I can use the stats module which compiles the sum of my attributes
on a certain facet , but how can I perform a test this result (i.e. Is
sum>100) within my stats query? From what I read, it's not supported yet
to perform a function on the stats module..
Any other way to do this ?

Cheers,
Matt












NOTE: This message may contain information that is confidential, 
proprietary, privileged or otherwise protected by law. The message is 
intended solely for the named addressee. If received in error, please 
destroy and notify the sender. Any use of this email is prohibited when 
received in error. Impetus does not represent, warrant and/or guarantee, 
that the integrity of this communication has been maintained nor that the 
communication is free of errors, virus, interception or interference. 



How to set a condition over stats result

2013-07-11 Thread Matt Lieber
>
Hello,

I am trying to see how I can test the sum of values of an attribute across
docs.
I.e. Whether sum(myfieldvalue)>100 .

I know I can use the stats module which compiles the sum of my attributes
on a certain facet , but how can I perform a test this result (i.e. Is
sum>100) within my stats query? From what I read, it's not supported yet
to perform a function on the stats module..
Any other way to do this ?

Cheers,
Matt












NOTE: This message may contain information that is confidential, proprietary, 
privileged or otherwise protected by law. The message is intended solely for 
the named addressee. If received in error, please destroy and notify the 
sender. Any use of this email is prohibited when received in error. Impetus 
does not represent, warrant and/or guarantee, that the integrity of this 
communication has been maintained nor that the communication is free of errors, 
virus, interception or interference.