1

我有以下 solr 架构

<?xml version="1.0" encoding="UTF-8" ?>
<schema name="testthing" version="1.5">
    <fields>
        <field name="_version_"     type="long"     indexed="true"  stored="true"   required="true"/>
        <field name="doc_id"        type="string"   indexed="true"  stored="true"   required="true"     multiValued="false"/>
        <field name="title"         type="string"   indexed="true"  stored="true"   required="false"    multiValued="false"/>
        <field name="doc_type"      type="string"   indexed="false" stored="true"   required="true"     multiValued="false"/>
        <field name="description"   type="string"   indexed="true"  stored="true"   required="false"    multiValued="false"/>
        <field name="allText"       type="fs_text"  indexed="true"  stored="false"  required="true"     multiValued="true"/>
    </fields>

    <uniqueKey>doc_id</uniqueKey>

    <copyField source="title" dest="allText" />
    <copyField source="description" dest="allText" />
    <dynamicField name="*" type="ignored" multiValued="true" />

    <types>
        <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
        <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
        <fieldType name="fs_text" class="solr.TextField" positionIncrementGap="100"/>
    </types>
</schema>

Solr 抱怨动态字段类型缺少字段文本

1898 [main] INFO  org.apache.solr.servlet.SolrDispatchFilter  ? SolrDispatchFilter.init() done
1918 [searcherExecutor-4-thread-1] ERROR org.apache.solr.core.SolrCore  ? org.apache.solr.common.SolrException: undefined field text at org.apache.solr.schema.IndexSchema.getDynamicFieldType(IndexSchema.java:1235)

但是,我唯一的一个动态字段(忽略所有不匹配)不使用文本类型(它是 type=ignore)。

我在这里想念什么?

** 到目前为止,将 allText 重命名为 text 几乎解决了这个问题,但我不知道为什么!Solr 4.1 中的文本有什么特殊/预定义的吗?

4

1 回答 1

2

这与字段类型“文本”无关。它是关于名为“文本”的字段。

<defaultSearchField>text</defaultSearchField>

您可能已经更改或删除了 config.xml 中的默认字段。如果这解决了问题,那么您知道配置中的某处您指的是“文本”字段,可能在 solrconfig.xml 中,如建议

于 2013-11-20T14:09:32.333 回答