Solr模式 - 字段的通配符冲突

时间:2017-07-16 14:21:51

标签: indexing solr search-engine solrj solarium

我正在从MongoDB索引大致类似于

的数据
{
    "name": "John Doe",
    "age": "25",
    "education": [
        {
            "title": "Masters",
            "status": 53,
            "finalProject": {
                "title": "Integrating Advanced STJs using KKO",
                "status": "In Progress"
            }
        },
        {
            "title": "Software Engineering",
            "status": 52,
            "finalProject": {
                "title": "Use of LPI in Multi-sanctioned BPDs",
                "status": "Completed"
            }
        },
        {
            "title": "Pre-Engineering",
            "status": 51
        },
        {
            "title": "Matriculation",
            "status": 52
        }
    ]
}

请注意,我有两个状态字段; education.*.status的一个是整数,另一个是education.*.finalProject.status。如何为两者指定copyFields?

我考虑在我的架构中将它们指定如下

<field name="projectStatus" type="string" stored="true" indexed="true" multiValued="true"/>
<copyField source="*.finalProject.status" dest="projectStatus"/>

<field name="educationStatus" type="int" stored="true" indexed="true" multiValued="true"/>
<copyField source="*.status" dest="educationStatus"/>

但由于*.status已涵盖*.finalProject.status,因此这两种模式似乎都存在冲突。如何在单独的副本字段中指定它们?

0 个答案:

没有答案