You could use an update processor to turn the text string into multiple
string values. A short snippet of JavaScript in a
StatelessScriptUpdateProcessor could do the trick. The field could then be a
multivalued string field.
-- Jack Krupansky
-----Original Message-----
From: Elran Dvir
Sent: Wednesday, June 26, 2013 7:14 AM
To: solr-user@lucene.apache.org
Subject: StatsComponent doesn't work if field's type is TextField - can I
change field's type to String
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.