点替换不起作用-elasticsearch

mqkwyuun  于 2021-06-15  发布在  ElasticSearch
关注(0)|答案(0)|浏览(285)

我有下面的elasticsearch索引配置。

PUT dottest
{
"settings":{
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
},
"analysis": {
"analyzer": {
"splchar_analyzer": {
"tokenizer": "standard",
"char_filter": [
"spl_char_filter"
],
"filter": [
"lowercase"
]
}
},
"char_filter": {
"spl_char_filter": {
"type": "pattern_replace",
"pattern": "\.",
"replacement": " "
}
}
}
},
"mappings": {
"properties": {
"text": {
"type": "text",
"analyzer": "splchar_analyzer"
}
}
}
}

它的工作,而检查使用以下要求。

POST dottest/_analyze
{
"analyzer": "splchar_analyzer",
"text": """This is something 152045.525"""
}

我得到了下面的令牌,这对我来说很好。

{
"tokens" : [
{
"token" : "this",
"start_offset" : 0,
"end_offset" : 4,
"type" : "",
"position" : 0
},
{
"token" : "is",
"start_offset" : 5,
"end_offset" : 7,
"type" : "",
"position" : 1
},
{
"token" : "something",
"start_offset" : 8,
"end_offset" : 17,
"type" : "",
"position" : 2
},
{
"token" : "152045",
"start_offset" : 18,
"end_offset" : 24,
"type" : "",
"position" : 3
},
{
"token" : "525",
"start_offset" : 25,
"end_offset" : 28,
"type" : "",
"position" : 4
}
]
}

当文档通过logstash脚本插入时,它不会用空格吐点。以下是实时索引文档示例:

{
"_index" : "indexname",
"_type" : "_doc",
"_id" : "1278041941",
"_version" : 2,
"found" : true,
"took" : 142,
"term_vectors" : {
"filecontent" : {
"field_statistics" : {
"sum_doc_freq" : 2848226634,
"doc_count" : 18534325,
"sum_ttf" : 6310068234
},
"terms" : {
"5961.20" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 20,
"start_offset" : 145,
"end_offset" : 152
}
]
},
"6119.27" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 23,
"start_offset" : 167,
"end_offset" : 174
}
]
},
"6153.10" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 17,
"start_offset" : 123,
"end_offset" : 130
}
]
},
"6339.60" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 14,
"start_offset" : 101,
"end_offset" : 108
}
]
},
"6819.20" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 11,
"start_offset" : 79,
"end_offset" : 86
}
]
},
"document" : {
"term_freq" : 2,
"tokens" : [
{
"position" : 1,
"start_offset" : 8,
"end_offset" : 16
},
{
"position" : 3,
"start_offset" : 22,
"end_offset" : 30
}
]
},
"for" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 5,
"start_offset" : 34,
"end_offset" : 37
}
]
},
"hrs" : {
"term_freq" : 5,
"tokens" : [
{
"position" : 10,
"start_offset" : 71,
"end_offset" : 74
},
{
"position" : 13,
"start_offset" : 93,
"end_offset" : 96
},
{
"position" : 16,
"start_offset" : 115,
"end_offset" : 118
},
{
"position" : 19,
"start_offset" : 137,
"end_offset" : 140
},
{
"position" : 22,
"start_offset" : 159,
"end_offset" : 162
}
]
},
"is" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 4,
"start_offset" : 31,
"end_offset" : 33
}
]
},
"labor" : {
"term_freq" : 5,
"tokens" : [
{
"position" : 9,
"start_offset" : 65,
"end_offset" : 70
},
{
"position" : 12,
"start_offset" : 87,
"end_offset" : 92
},
{
"position" : 15,
"start_offset" : 109,
"end_offset" : 114
},
{
"position" : 18,
"start_offset" : 131,
"end_offset" : 136
},
{
"position" : 21,
"start_offset" : 153,
"end_offset" : 158
}
]
},
"only" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 8,
"start_offset" : 54,
"end_offset" : 58
}
]
},
"purpose" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 7,
"start_offset" : 46,
"end_offset" : 53
}
]
},
"testing" : {
"term_freq" : 2,
"tokens" : [
{
"position" : 0,
"start_offset" : 0,
"end_offset" : 7
},
{
"position" : 6,
"start_offset" : 38,
"end_offset" : 45
}
]
},
"this" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 2,
"start_offset" : 17,
"end_offset" : 21
}
]
}
}
}
}
}

下面的文字没有吐出来。
工时:-6819.20工时:-6339.60工时:-6153.10工时:-5961.20工时:-6119.27
在Map或日志存储方面有什么问题吗?在这个问题上有人能帮我吗?
谢谢

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题