Skip to content

grossws/solr-dvtf

Repository files navigation

Info

DocValues-enabled TextField for Apache Solr.

Usage

DocValuesTextField

Add some fieldTypes to solr schema.xml (and fields using them):

<schema name="example" version="1.5">
  <!-- ... -->

  <field name="ne" type="ne_string"/>
  <field name="nef" type="nef_string"/>
  <copyField source="ne" dest="nef"/>

  <!-- ... -->

  <fieldType name="nef_string" class="org.anenerbe.solr.DocValuesTextField"
             indexed="false" stored="false" multiValued="true" docValues="true">
    <analyzer type="index">
      <tokenizer class="solr.KeywordTokenizerFactory"/>
      <filter class="solr.ASCIIFoldingFilterFactory"/>
      <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
    <analyzer type="query">
      <tokenizer class="solr.KeywordTokenizerFactory"/>
      <filter class="solr.ASCIIFoldingFilterFactory"/>
      <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
  </fieldType>

  <fieldType name="ne_string" class="org.anenerbe.solr.DocValuesTextField"
             indexed="true" stored="true" multiValued="true" docValues="true">
    <analyzer type="index">
      <tokenizer class="solr.KeywordTokenizerFactory"/>
      <filter class="solr.ASCIIFoldingFilterFactory"/>
      <filter class="solr.LowerCaseFilterFactory"/>
      <filter class="solr.ReversedWildcardFilterFactory"/>
    </analyzer>
    <analyzer type="query">
      <tokenizer class="solr.KeywordTokenizerFactory"/>
      <filter class="solr.ASCIIFoldingFilterFactory"/>
      <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
  </fieldType>

  <!-- ... -->
</schema>

Licensing

Licensed under MIT License. See LICENSE file.