Hi Alex,

I already have defined my field type which in this case is called
"text_en".  Here is how it looks like:

  <fieldType name="text_en" class="solr.TextField"
autoGeneratePhraseQueries="true" positionIncrementGap="100">
    <analyzer type="index">
      <tokenizer class="solr.WhitespaceTokenizerFactory"/>
      <filter class="solr.LimitTokenCountFilterFactory"
consumeAllTokens="true" maxTokenCount="2147483647"/>
      <filter class="solr.SynonymGraphFilterFactory" expand="false"
ignoreCase="true" synonyms="synonyms.txt"/>
       .......... ..........

Are you saying I can add to the fieldType properties such as "multiValued"
and "stored"?  If so, I never knew this and I don't know where they go.  Is
this how it would be:

    <fieldType name="text_en" class="solr.TextField"
autoGeneratePhraseQueries="true" positionIncrementGap="100"
multiValued="true" stored="false" >

Thanks

Steven


On Tue, Mar 23, 2021 at 7:50 PM Alexandre Rafalovitch <arafa...@gmail.com>
wrote:

> Can you just define a new field type with all those parameters you want
> "text_en_mine" and map to that?
>
> Regards,
>     Alex
>
> On Tue., Mar. 23, 2021, 7:32 p.m. Steven White, <swhite4...@gmail.com>
> wrote:
>
> > Hi Everyone,
> >
> > I have the following block of code in my solrconfig.xml
> >
> >   <updateProcessor class="solr.AddSchemaFieldsUpdateProcessorFactory"
> > name="add-schema-fields">
> >     <lst name="typeMapping">
> >       <str name="valueClass">java.lang.String</str>
> >       <str name="fieldType">text_en</str>
> >       <!-- Use as default mapping instead of defaultFieldType -->
> >       <bool name="default">true</bool>
> >     </lst>
> >
> > This is creating a new field like so:
> >
> >   <field name="Name" type="text_en"/>
> >
> > I need it to include additional field settings, so that I would have the
> > following:
> >
> >   <field name="Name" type="text_en" multiValued="true" indexed="true"
> > required="false" stored="false"/>
> >
> > I need to have be able to set the value for "multiValued" and "stored"
> > because based on Solr doc [1], if those 2 properties are missing, the
> > default will be used and thus I would end up with:
> >
> >   <field name="Name" type="text_en" multiValued="false" indexed="true"
> > required="false" stored="true"/>
> >
> > (See how "multiValued" is "false" and "stored" is "true").
> >
> > Can someone tell me how I can provide these additional properties on
> > "typeMapping" of dynamic field creation?
> >
> > Thanks
> >
> > Steven
> >
> > [1] https://solr.apache.org/guide/8_6/defining-fields.html
> >
>

Reply via email to