java - Add a custom field type in solr -
in solr schema.xml many field types defined. example
<fieldtype name="int" class="solr.trieintfield" precisionstep="0" positionincrementgap="0"/>
is definition integer field.
how define custom field types inside solr?
is possible add java types such biginteger, bigdecimal, map , other types field type in solr?
you can define new custom fields in solr adding them schema.xml
in <fields>
element:
<fields> ... <field name="newfieldname" type="text_general" indexed="true" stored="true" multivalued="true"/> ... </fields>
to have overview on supported types (used define <fieldtype>
in solr, used define field
elements), take link: https://cwiki.apache.org/confluence/display/solr/field+types+included+with+solr. example, type
"text_general" defined in schema.xml as:
<fieldtype name="text_general" class="solr.textfield" positionincrementgap="100"> <analyzer type="index"> <tokenizer class="solr.standardtokenizerfactory"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="stopwords.txt" enablepositionincrements="true" /> <filter class="solr.lowercasefilterfactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.standardtokenizerfactory"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="stopwords.txt" enablepositionincrements="true" /> <filter class="solr.synonymfilterfactory" synonyms="synonyms.txt" ignorecase="true" expand="true"/> <filter class="solr.lowercasefilterfactory"/> </analyzer> </fieldtype>
you can see uses class="solr.textfield"
basic field type. solr schema has several types
defined default... can define more, not sure if can defined ones asking for.
Comments
Post a Comment