Configure schema.xml
Location:
-
Solr 9.6: [SOLR INSTALL DIR]/server/solr/<corename>/conf/schema.xml
-
Solr 10: [SOLR INSTALL DIR]/server/solr/collection1/conf/schema.xml
schema.xml – mandatory fields
The following fields must remain configured with stored="true" at minimum. ImageMaster’s database filter stage (SearchHitList.runFilterQuery()) requires them to correctly map Solr results back to document revisions:
|
Field |
Requirement |
Reason |
|---|---|---|
|
id |
indexed="true" stored="true" |
Solr unique key |
|
documentid |
indexed="true" stored="true" |
Maps Solr result → ImageMaster document |
|
revisionid |
indexed="true" stored="true" |
Maps Solr result → specific revision |
|
Table 333: schema.xml – mandatory fields |
||
If any of these fields has stored="false", the document cannot be mapped to a revision - it will not appear in the result list at all, even though it was found by the full-text query.
<!-- Document metadata (NOT multivalued) --> <field name="revisionid" type="string" indexed="true" stored="true" multiValued="false"/> <field name="documentid" type="string" indexed="true" stored="true" multiValued="false"/> <field name="documenttype" type="string" indexed="true" stored="true" multiValued="false"/> <!-- Attachment metadata (MULTIVALUED - one entry per attachment) --> <field name="binaryid" type="string" indexed="true" stored="true" multiValued="true"/> <field name="contentname" type="string" indexed="true" stored="true" multiValued="true"/> <field name="mimetype" type="string" indexed="true" stored="true" multiValued="true"/> <!-- Extracted fulltext (MULTIVALUED - accumulated from all attachments) --> <field name="fulltext" type="text_general" indexed="true" stored="true" multiValued="true"/>
Highlighting: If you want search result snippets/highlighting, the fulltext and unitedmetadata fields also need stored="true" (already the default in the shipped schema.xml).
schema.xml – search mode fine-tuning
The following full-text search modes are supported and use separate internal fields:
|
Search mode |
Fields used |
Description |
|---|---|---|
|
Standard search |
fulltext, unitedmetadata |
Language-dependent word stemming, stop word removal. Language-specific variants (e.g., fulltext_de, fulltext_en) are auto-populated via langid. |
|
Phrase search |
fulltext_phrase, unitedmetadata_phrase |
Exact phrase matching. Triggered by double-quotation marks in the search field. |
|
Wildcard search |
fulltext_wildcard, unitedmetadata_wildcard |
Asterisk (*) and question mark (?) wildcard support. Supports leading wildcards. |
|
Table 334: schema.xml – search modes |
||
These fields are configured in the <fields> section of schema.xml and auto-populated from the base fulltext field via <copyField> directives:
<!-- Standard full-text (populated by extraction, fed to langid for language variants) --> <field name="fulltext" type="text_general" indexed="true" stored="true" multiValued="true"/> <field name="fulltext_de" type="text_stemming_de" indexed="true" stored="true" multiValued="true"/> <field name="fulltext_en" type="text_stemming_en" indexed="true" stored="true" multiValued="true"/> <!-- Phrase search (populated by copyField from fulltext) --> <field name="fulltext_phrase" type="text" indexed="true" stored="true" multiValued="true"/> <field name="unitedmetadata_phrase" type="text" indexed="true" stored="true" multiValued="true"/> <!-- Wildcard search (populated by copyField from fulltext; disabled by default to save space) --> <field name="fulltext_wildcard" type="text_wildcard" indexed="false" stored="false" multiValued="true"/> <field name="unitedmetadata_wildcard" type="text_wildcard" indexed="false" stored="false" multiValued="true"/>
To selectively activate or deactivate a search mode, set indexed and stored on the relevant field:
<!-- DISABLE phrase search (saves index space; phrase queries fall back to standard) --> <field name="fulltext_phrase" type="text" indexed="false" stored="false" multiValued="true"/> <field name="unitedmetadata_phrase" type="text" indexed="false" stored="false" multiValued="true"/> <!-- ENABLE wildcard search (larger index; required for leading-wildcard queries) --> <field name="fulltext_wildcard" type="text_wildcard" indexed="true" stored="true" multiValued="true"/> <field name="unitedmetadata_wildcard" type="text_wildcard" indexed="true" stored="true" multiValued="true"/>
To reduce memory and CPU usage you can selectively activate or deactivate indexing for the different search modes. In the <fields> section of schema.xml, set the field attributes indexed and stored to false for modes you do not need. By deactivating an index, the corresponding search mode no longer supports full-text search.
It is possible to share an index for multiple purposes - for example, using the phrase search index for both phrase and wildcard queries. Such customizations are project-specific and should only be implemented in cooperation with your T-Systems contact.
schema.xml – maximum token count
By default, full-text indexing is applied to complete documents. For very large documents this can consume significant memory and slow overall indexing throughput. If all relevant search terms are typically found at the beginning of a document (e.g., in the table of contents or foreword), you can limit how many tokens are indexed per field using LimitTokenCountFilterFactory.
The shipped schema.xml includes this filter commented out in all field type definitions. To activate it, uncomment the <filter> line in the relevant field type’s <analyzer type="index"> block:
Maximum token count in field type definition
<fieldType name="text_stemming_de" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<!-- Uncomment to limit indexing to the first N tokens per field value.
Useful when large documents with many tokens slow down indexing and
all relevant terms appear near the beginning of a document. -->
<!-- <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/> -->
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt"/>
<filter class="solr.WordDelimiterGraphFilterFactory" .../>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.SnowballPorterFilterFactory" language="German2" protected="protwords.txt"/>
</analyzer>
...
</fieldType>
Repeat for every fieldType you want to limit (text_general, text_stemming_en, text, text_wildcard, etc.).
When to use this: Limiting token count makes sense only when many large documents with many tokens enter the indexing pipeline. For environments with many small documents, the overhead is negligible and the filter should be left disabled. If very large documents are expected, also consider an appropriate hardware infrastructure or a distributed search architecture with multiple shards.