当前位置:网站首页>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"
}
}
}
}
边栏推荐
- Redis interview questions
- Halcon draw area into picture
- 10_ Those high-profile personal signatures
- 09_一种比较高效的记忆方法
- `Thymeleaf`模板引擎全面解析
- OpenHarmony 1
- C language ---18 function (user-defined function)
- R language plot visualization: the visualization model creates a grid in the classification contour (contour) and meshgrid of the entire data space, in which the distance between each point is determi
- 文本对比学习综述
- 厨卫电器行业B2B交易协同管理平台开发,优化企业库存结构
猜你喜欢

Explore cloud native databases and take a broad view of future technological development

box-sizing

Virtual machines on the same distributed port group but different hosts cannot communicate with each other

In the eyes of the universe, how to correctly care about counting East and West?

Idea connection MySQL custom generated entity class code

【从零开始学zabbix】一丶Zabbix的介绍与部署Zabbix

Linux Installation cenos7 MySQL - 8.0.26

IDEA连接mysql自定义生成实体类代码

【LeetCode】10、正则表达式匹配

Baidu map API drawing points and tips
随机推荐
Solution of channel management system for food and beverage industry: realize channel digital marketing layout
二造考生必看|巩固优选题库助力考生最后冲刺
June training (day 24) - segment tree
六石管理学:垃圾场效应:工作不管理,就会变成垃圾场
tongweb使用之端口冲突处理办法
[ansible problem processing] remote execution user environment variable loading problem
STM32F1与STM32CubeIDE编程实例-WS2812B全彩LED驱动(基于SPI+DMA)
Six stones Management: garbage dump effect: if you don't manage your work, you will become a garbage dump
Virtual machines on the same distributed port group but different hosts cannot communicate with each other
IDEA连接mysql自定义生成实体类代码
业务与技术双向结合构建银行数据安全管理体系
GO语言并发模型-MPG模型
[bitbear story collection] June MVP hero story | technology practice collision realm thinking
09_一种比较高效的记忆方法
10 Ces autographes très stylisés.
Second, the examinee must see | consolidate the preferred question bank to help the examinee make the final dash
laravel 8 实现Auth登录
一文搞定 UDP 和 TCP 高频面试题!
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!
postgresql之词法分析简介