lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven White <swhite4...@gmail.com>
Subject Schema API: add-field-type
Date Wed, 29 Apr 2015 22:50:26 GMT
Hi Everyone,

When I pass the following:
http://localhost:8983/solr/db/schema/fieldtypes?wt=xml

I see this (as one example):

  <lst>
    <str name="name">date</str>
    <str name="class">solr.TrieDateField</str>
    <str name="precisionStep">0</str>
    <str name="positionIncrementGap">0</str>
    <arr name="fields">
      <str>last_modified</str>
    </arr>
    <arr name="dynamicFields">
      <str>*_dts</str>
      <str>*_dt</str>
    </arr>
  </lst>

See how there is "fields" and "dynamicfields"?  However, when I look in
schema.xml, I see this:

  <fieldType name="date" class="solr.TrieDateField" precisionStep="0"
positionIncrementGap="0"/>

See how there is nothing about "fields" and "dynamicfields".

Now, when I look further into the schema.xml, I see they are coming from:

  <field name="last_modified" type="date" indexed="true" stored="true"/>
  <dynamicField name="*_dt"  type="date"    indexed="true"  stored="true"/>
  <dynamicField name="*_dts" type="date"    indexed="true"  stored="true"
multiValued="true"/>

So it all makes sense.

Does this means the response of "fieldtypes" includes "fields" and
"dynamicfields" as syntactic-sugar to let me know of the relationship this
field-type has or is there more to it?

The reason why I care about this question is because I'm using Solr's
Schema API (see: https://cwiki.apache.org/confluence/display/solr/Schema+API)
to make changes to my schema.  Per this link:
https://cwiki.apache.org/confluence/display/solr/Schema+API#SchemaAPI-AddaNewFieldType
it shows how to add a field-type via "add-field-type" but there is no
mention of "fields" or "dynamicfields" in this API.  My assumption is
"fields" and "dynamicfields" need not be part of this API, instead it is
done via "add-field" and "add-dynamic-field", thus what I see in the XML of
"fieldtypes" response is just syntactic-sugar.  Did I get all this right?

Thanks

Steve

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message