分析在ElasticSearch中编入索引的术语

时间:2016-08-24 07:50:11

标签: elasticsearch analyzer luke

所以我有一个定制的分析器,可以从本体中添加额外的术语。另外,我希望在它们被索引之前完成术语的限制。以下是从 elasticsearch head插件中获取的index metadata

{
    "state": "open",
    "settings": {
        "index": {
            "refresh_interval": "1000s",
            "number_of_shards": "5",
            "creation_date": "1471931611750",
            "analysis": {
                "filter": {
                    "owlfilter": {
                        "type": "owl",
                        "indexName": "ontoowl",
                        "expansionType": "RDFSLABEL",
                        "owlFile": "/home/tannys/elasticsearch-2.3.0/ontologyWorkTrial/myownowl.owl"
                    }
                },
                "analyzer": {
                    "owlanalyzer": {
                        "filter": ["owlfilter","porter_stem"],
                        "type": "custom",
                        "tokenizer": "standard"
                    }
                }
            },
            "number_of_replicas": "1",
            "uuid": "d8Ub8A0eSm65geMK_bpdvw",
            "version": {"created": "2030099"}
        }
    },
    "mappings": {
        "mytype": {
            "properties": {
                "nameortitle": {
                    "search_analyzer": "standard",
                    "analyzer": "owlanalyzer",
                    "store": true,
                    "type": "string"
                },
                "description": {
                    "search_analyzer": "standard",
                    "analyzer": "owlanalyzer",
                    "store": true,
                    "type": "string"
                }
            },
            "aliases": [ ]
        }
    }
}

问题的讽刺是,在我使用porter_stem过滤器之前,结果更好。所以我不太确定,出了什么问题。我希望看到被索引的术语。我怎样才能看出分析仪的性能如何,比如卢克为Lucene所做的一切? 任何指导。

1 个答案:

答案 0 :(得分:1)

您可以使用术语向量API here。这将为您提供文档中字段的条款,或者您也可以使用multi-term API以相同方式查看多个文档中的字词。