user1732578
user1732578

Reputation: 1

Solr 4 indexing creates a field with no name but all field values concatenated as value for this field

I have several text_en fields in Solr which are "Indexed" but not "Stored". I store these large text values for the document in MongoDb. However when I look at the Solr index, every document has a field which has no name. But all the fields of the document (including the indexed but not stored) are stored in this field.

What is this field and how can I eliminate it. It is increasing the size of my index.

 <fields>
  <dynamicField indexed="true" name="*_i" stored="true" type="int"/>
  <dynamicField indexed="true" name="*_s" stored="true" type="string"/>
  <dynamicField indexed="true" name="*_l" stored="true" type="long"/>
  <dynamicField indexed="true" name="*_t" stored="true" type="text_en"/>
  <dynamicField indexed="true" name="*_b" stored="true" type="boolean"/>
  <dynamicField indexed="true" name="*_f" stored="true" type="float"/>
  <dynamicField indexed="true" name="*_d" stored="true" type="double"/>
  <dynamicField indexed="true" name="*_tiled" stored="false" type="double"/>
  <dynamicField indexed="true" name="*_dt" stored="true" type="date"/>
  <dynamicField indexed="true" name="*_p" stored="true" type="location"/>
  <dynamicField name="random_*" type="random"/>
  <dynamicField indexed="true" multiValued="true" name="attr_*" stored="true" type="string"/>
  <dynamicField indexed="true" multiValued="true" name="*" stored="true" type="text_en"/>
  <dynamicField indexed="true" multiValued="true" name="attr_*" stored="true" type="string"/>
  <!-- My Custom Fields -->
  <uniqueKey>id</uniqueKey>
  <defaultSearchField>text_all</defaultSearchField>
  <solrQueryParser defaultOperator="AND"/>

  <copyField dest="author_display" source="author"/>
  <copyField dest="keywords_display" source="keywords"/>

  <copyField dest="text_all" source="id"/>
  <copyField dest="text_all" source="url"/>
  <copyField dest="text_all" source="title"/>
  <copyField dest="text_all" source="description"/>
  <copyField dest="text_all" source="keywords"/>
  <copyField dest="text_all" source="author"/>
  <copyField dest="text_all" source="body"/>
  <copyField dest="text_all" source="*_t"/>

  <copyField dest="spell" source="title"/>
  <copyField dest="spell" source="body"/>
  <copyField dest="spell" source="description"/>
  <copyField dest="spell" source="author"/>

  <copyField dest="autocomplete" source="title"/>
  <copyField dest="autocomplete" source="body"/>
  <copyField dest="autocomplete" source="description"/>
  <copyField dest="autocomplete" source="author"/>
</fields>

Upvotes: 0

Views: 392

Answers (1)

Paige Cook
Paige Cook

Reputation: 22555

You are seeing this behavior because of the following entry in your schema.xml file

<dynamicField indexed="true" multiValued="true" name="*" stored="true" type="text_en"/>

This a generic catch all field that you have defined in your schema. If you pass any documents to the index field names that do not match other fields in the schema either by convention (via your other dynamicField settings) or specific field names, Solr will create that field "on the fly" as a text_en type that can have multiple entries since it is setup as multiValued="true". And these fields are all being stored as well because of stored="true" setting. I would recommend removing this field from your schema.xml and reindexing your data.

For more details on the settings in this file, please reference - SchemaXml on the Solr Wiki.

Upvotes: 3

Related Questions