gpt4 book ai didi

elasticsearch - Elasticsearch如何分析数字?

转载 作者:行者123 更新时间:2023-12-03 01:38:22 25 4
gpt4 key购买 nike

我有一些这样的数据:

{"date": "2018-04-29T00:36", "price": 11900, "sellerName": "Leif J", "description": "Nybesiktigad U.A 2018-04-28 vid 2291mil. 360 mil p\u00e5 senaste 6 \u00e5ren. Ej vinterk\u00f6rd, och varmgarage p\u00e5 varje vinterf\u00f6rvaring (i min \u00e4go.) Extra ut\u00f6ver standard: -Eluppv\u00e4rmda handtag (2l\u00e4ges) -LED lampor -Avtagbar packbox. -TK Hydrotech avgassystem (ca 10% effekt) L\u00e4nkar nedan: https://www.youtube.com/watch?v=vqa_AiNq8-4 http://www.turbokit.net/#sthash.MboS0Bf2.dpbs L\u00e4s g\u00e4rna Expressens omd\u00f6me* f\u00f6r mer info (*fel i artikeln=varvr\u00e4knare finnes) https://www.expressen.se/motor/tester/en-fatolj-pa-hjul/ Billig i skatt / f\u00f6rs\u00e4kring / drift. Kymco, Grand Dink, 150, Scooter, Maxi, Maxiscooter, Vespa, Piaggio", "location": "Malm\u00f6, Sydv\u00e4st", "id": 0, "title": "Kymco Grand Dink 250", "modelYear": 2002, "url": "https://www.blocket.se/malmo/Kymco_Grand_Dink_250_79092265.htm?ca=11&w=3", "vehicleType": "Scooter"}}

如您所见, pricemodelYear字段是数字。如果我使用默认设置将此文档编入索引,Elasticsearch似乎会自动识别出这些字段是数字。像这样:
POST _search:

{
"query": {
"bool": {
"must": {
"multi_match": {
"fields": [
"title^1.0",
"description"
],
"operator": "or",
"query": "honda",
"type": "cross_fields"
}
}
}
}
}

返回:
        {
"_index": "simple",
"_type": "motorcycle",
"_id": "XZu-Y2MByJQ0ZKmCDVzt",
"_score": 4.3209167,
"_source": {
"date": "2018-03-28T00:00",
"price": 67900,
"sellerName": "Honda Mc Center Vänersborg",
"description": "Honda VFR800A Mätarställning: 2800 mil Färg: Svartmetallic Typ: Touring/Landsväg Info: en härlig v-fyra i bra skick, Nyservad, värmehandtag, däck ok, GIVI väskor, Top box Oxford Honda, Honda VFR, VFR, VFR 800, Honda touring, Honda sport touring, Touring, Bankörning, banhoj",
"location": "Vänersborg",
"id": 13561,
"title": "Honda VFR800A",
"modelYear": 2008,
"url": "https://www.blocket.se/alvsborg/Honda_VFR800A_78000747.htm?ca=11&w=3",
"vehicleType": "Touring"
}
}

数字字段周围没有引号,因此它们似乎是数字。我的问题是,如何对数字字段进行分析(如果有的话)?我找不到任何有关Elasticsearch识别字段为数字以及随后对该字段建立索引时执行何种分析的过程的文档。

有人可以告诉我在哪里可以读到它?

最佳答案

我不确定我是否完全理解问题,但是文档中的字段是键入的-Elasticsearch不会“识别字段”,它们是在索引级别定义的。

Official docs

编辑:看起来您的索引可能是自动创建的,所以您要查找的是dynamic field mapping.

关于elasticsearch - Elasticsearch如何分析数字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50350145/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com