aName
aName

Reputation: 3043

what is the difference between TextField and text_general in solr

I'm newbie to solr, through some tutorial I discovered that there is text_general type and I assume that it is used for text type (one or many word...) and then in the reference documentation, I found that there is also TextField that is also used for Text, usually multiple words or tokens.
so what is the difference between the two, and when to use one instead of the other

Upvotes: 2

Views: 1947

Answers (1)

kuhajeyan
kuhajeyan

Reputation: 11017

TextField is a basic field type that is included in solr that you can used to index/analyze usually multiple words or tokens. Means you can use this for matching something part of sentence.

text_general isnt basic solr field type, it is simply extended type from text field which you define based on your indexing and querying requirement. So simply you create/define this field.

Sample field type for text_general

<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" />
    <!-- in this example, we will only use synonyms at query time
    <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
    -->
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>

Upvotes: 1

Related Questions