当前位置:网站首页>Mots clés pour la cartographie es; Ajouter une requête par mot - clé à la requête term; Changer le type de mot - clé de cartographie
Mots clés pour la cartographie es; Ajouter une requête par mot - clé à la requête term; Changer le type de mot - clé de cartographie
2022-06-24 14:24:00 【Loong XL】
RÉFÉRENCES:https://blog.csdn.net/winterking3/article/details/108254346
https://blog.csdn.net/tclzsn7456/article/details/79956625
1、ES mappingDekeyword
Par défautmappingLa structure est généralement:
Si ce n'est pas réglémapping,ESPar défaut, la chaîne est définie àtextType,Et contient unkeywordSous - type.
***Ce champ d'enregistrement de structure contient deux index(Compréhension personnelle),Le premiertype textCeci est indexé et sauvegardé,Derrière.fields keywordEnregistrer l'ajout complet de la chaîne
termRequête
1)Directterm
(Structure introuvable,C'est parce qu'il n'y a pas de défauttextType,Ce champ est sauvegardé avec un participant,Par exemple, le film est divisé en deux mots: l'électricité et l'ombre.)
{
"query": {
"bool": {
"must": [
{
"term": {
"channel": "Film"
}
}
]
}
}
}
L'index ici est changé en une seule requête de mot
{
"query": {
"bool": {
"must": [
{
"term": {
"channel": "Électricité"
}
}
]
}
}
}
##Ou
{
"query": {
"bool": {
"must": [
{
"term": {
"channel": "Shadow"
}
}
]
}
}
}
Ou avecmatchRequête, Ceci va être segmenté avant la recherche
{
"query": {
"bool": {
"must": [
{
"match": {
"channel": "Film"
}
}
]
}
}
}
2) Requête de correspondance complète spécifique term+keywod
Cette requête sera basée sur mapping Type de doublure keywordCorrespondance des champs, Doit contenir une chaîne de requête sans mot , C'est l'équivalent de la chaîne originale avant le mot de requête
{
"query": {
"bool": {
"must": [
{
"term": {
"channel.keyword": "Film"
}
}
]
}
}
}
3、Changementmapping keywordType
Retirer directementtextÀ ce niveau.,C'est parti.textModifier comme suit:keyword, Tout cela peut être fait directement term La requête correspond à tous les mots sans segmentation ,Pas besoin d'ajouterkeyword
#ParamètreschannelPourkeyword
PUT pigg_user
{
"mappings": {
"properties": {
"channel": {
"type": "keyword"
},
"age": {
"type": "short"
}
}
}
}
边栏推荐
- [learn ZABBIX from scratch] I. Introduction and deployment of ZABBIX
- Go language -init() function - package initialization
- 成功解决:selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This versi
- Unity 热力图建立方法
- 从pair到unordered_map,理论+leetcode题目实战
- v-if 和 v-show 的区别
- 不要小看了积分商城,它的作用可以很大
- leetcode:1504. Count the number of all 1 sub rectangles
- Keras深度学习实战(11)——可视化神经网络中间层输出
- MySQL log management, backup and recovery
猜你喜欢

Research on MySQL composite index

Successfully solved: selenium common. exceptions. SessionNotCreatedException: Message: session not created: This versi
![[learn ZABBIX from scratch] I. Introduction and deployment of ZABBIX](/img/d1/4b21c8049f0377b54a18a9b267432e.png)
[learn ZABBIX from scratch] I. Introduction and deployment of ZABBIX

Overview of SAP marketing cloud functions (IV)

Port conflict handling method for tongweb

文本对比学习综述

Go language concurrency model mpg model

食品饮料行业渠道商管理系统解决方案:实现渠道数字化营销布局

The function and principle of key in V-for

Unit contour creation method
随机推荐
The difference between V-IF and v-show
食品饮料行业渠道商管理系统解决方案:实现渠道数字化营销布局
leetcode.12 --- 整数转罗马数字
P2PDB 白皮书
Antd checkbox, limit the selected quantity
Common singleton mode & simple factory
puzzle(016.2)指画星河
Rasa 3. X learning series - it is a great honor to be a source code contributor of Rasa contributors, and to build and share the rasa community with rasa source code contributors all over the world!
JS remove string spaces
Defoaming
IDEA连接mysql自定义生成实体类代码
Common sense knowledge points
【ansible问题处理】远程执行用户环境变量加载问题
GO语言-init()函数-包初始化
Go language -init() function - package initialization
21set classic case
Overview of SAP marketing cloud functions (III)
Explore cloud native databases and take a broad view of future technological development
Preliminary study on AQS
In the eyes of the universe, how to correctly care about counting East and West?