I stand corrected, you're absolutely right about string types. But I still
don't think text types are supported, at least in my quick test of the
stock Solr distro, trying to gather stats on the "subject" field produced
the error below. Note that string is a completely unanalyzed type, no
tokenization etc. so it's actually a different beast than text types.

Field type
text_general{class=org.apache.solr.schema.TextField,analyzer=org.apache.solr.analysis.TokenizerChain,args={class=solr.TextField,
positionIncrementGap=100}} is not currently supported


On Wed, Jun 26, 2013 at 11:37 AM, Elran Dvir <elr...@checkpoint.com> wrote:

> Erick, thanks for the response.
>
> I think the stats component works with strings.
>
> In StatsValuesFactory, I see the following code:
>
> public static StatsValues createStatsValues(SchemaField sf) {
>     ...
>    else if (StrField.class.isInstance(fieldType)) {
>       return new StringStatsValues(sf);
>     } ....
>   }
>
> -----Original Message-----
> From: Erick Erickson [mailto:erickerick...@gmail.com]
> Sent: Wednesday, June 26, 2013 5:30 PM
> To: solr-user@lucene.apache.org
> Subject: Re: StatsComponent doesn't work if field's type is TextField -
> can I change field's type to String
>
> From the stats component page:
>
> "The stats component returns simple statistics for indexed numeric fields
> within the DocSet"
>
> So string, text, anything non-numeric won't work. You can declare it
> multiValued but then you have to add multiple values for the field when you
> send the doc to Solr or implement a custom update component to break them
> up. At least there's no filter that I know of that takes a delimited set of
> numbers and transforms them.
>
> FWIW,
> Erick
>
> On Wed, Jun 26, 2013 at 4:14 AM, Elran Dvir <elr...@checkpoint.com> wrote:
> > Hi all,
> >
> > StatsComponent doesn't work if field's type is TextField.
> > I get the following message:
> > "Field type
> > textstring{class=org.apache.solr.schema.TextField,analyzer=org.apache.
> > solr.analysis.TokenizerChain,args={positionIncrementGap=100,
> > sortMissingLast=true}} is not currently supported".
> >
> > My field configuration is:
> >
> > <fieldType name="mvstring" class="solr.TextField" positionIncrementGap=
> "100" sortMissingLast="true">
> >             <analyzer type="index">
> >                 <tokenizer class="solr.PatternTokenizerFactory"
> pattern="\n" />
> >             </analyzer>
> > </fieldType>
> >
> > <field name="myField" type="mvstring" indexed="true" stored="false"
> > multiValued="true"/>
> >
> > So, the reason my field is of type TextField is that in the document
> indexed there may be multiple values in the field separated by new lines.
> > The tokenizer is splitting it to multiple values and the field is
> indexed as multi-valued field.
> >
> > Is there a way I can define the field as regular String field? Or a way
> to make StatsComponent work with TextField?
> >
> > Thank you very much.
>
> Email secured by Check Point
>

Reply via email to