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 YouPeng Yang <yy...@gmail.com> on 2014/09/18 09:46:26 UTC

How to summarize a String Field ?

Hi

   One of my filed called AMOUNT  is  String,and I want to  calculate the
sum of the this filed.
    I have try it with the stats component,it only give out the stats
information without sum item just as following:

<lst name="AMOUNT">
     <str name="min">000000000000</str>
     <str name="max">500000000000</str>
     <long name="count">24230</long>
     <long name="missing">26362</long>
      <lst name="facets"/>
</lst>

   Is there any ways to achieve this object?

Regards

Re: How to summarize a String Field ?

Posted by Jack Krupansky <ja...@basetechnology.com>.
Do a <copyField> to a numeric field.

-- Jack Krupansky

-----Original Message----- 
From: Erick Erickson 
Sent: Thursday, September 18, 2014 11:35 AM 
To: solr-user@lucene.apache.org 
Subject: Re: How to summarize a String Field ? 

You cannot do this as far as I know, it must be a numeric field
(float/int/tint/tfloat whatever).

Best
Erick

On Thu, Sep 18, 2014 at 12:46 AM, YouPeng Yang
<yy...@gmail.com> wrote:
> Hi
>
>    One of my filed called AMOUNT  is  String,and I want to  calculate the
> sum of the this filed.
>     I have try it with the stats component,it only give out the stats
> information without sum item just as following:
>
> <lst name="AMOUNT">
>      <str name="min">000000000000</str>
>      <str name="max">500000000000</str>
>      <long name="count">24230</long>
>      <long name="missing">26362</long>
>       <lst name="facets"/>
> </lst>
>
>    Is there any ways to achieve this object?
>
> Regards

Re: How to summarize a String Field ?

Posted by Erick Erickson <er...@gmail.com>.
You cannot do this as far as I know, it must be a numeric field
(float/int/tint/tfloat whatever).

Best
Erick

On Thu, Sep 18, 2014 at 12:46 AM, YouPeng Yang
<yy...@gmail.com> wrote:
> Hi
>
>    One of my filed called AMOUNT  is  String,and I want to  calculate the
> sum of the this filed.
>     I have try it with the stats component,it only give out the stats
> information without sum item just as following:
>
> <lst name="AMOUNT">
>      <str name="min">000000000000</str>
>      <str name="max">500000000000</str>
>      <long name="count">24230</long>
>      <long name="missing">26362</long>
>       <lst name="facets"/>
> </lst>
>
>    Is there any ways to achieve this object?
>
> Regards