Semantic_text 字段默认嵌入模型变为 .jina-embeddings-v5-text-small

在早期的 Elastic Stack 版本(9.4 之前),当我们定义 semantic_text 字段时,没有指名它的 inference endpoint,那么它的默认 inference endpoint 就是 .elser_model_2。从 Elastic Stack 9.4 之后,我们可以看到这个变化。比如:

bash 复制代码
`

1.  PUT semantic_text
2.  {
3.    "mappings": {
4.      "properties": {
5.        "content": {
6.          "type": "text",
7.          "copy_to": "inference_field"
8.        },
9.        "inference_field": {
10.          "type": "semantic_text"
11.        }
12.      }
13.    }
14.  }

`AI写代码![](https://csdnimg.cn/release/blogv2/dist/pc/img/runCode/icon-arrowwhite.png)

如上所示,我们定以了一个叫做 content 的字段,它的类型是 text。我们同时也把它拷贝到 inference_field 字段,而它的类型是 semantic_text。在上面,我们并没有标注它的 inference id。那么在默认的情况下,它的 inference id 是什么呢?

我们可以打入如下的命令:

bash 复制代码
`GET semantic_text/_mapping` AI写代码

我们可以看到在默认的情况下,它的 inference_id 是 .jina-embeddings-v5-text-small,也就是说它支持上百种语音。

我们做一个简单的例子:

css 复制代码
`

1.  PUT semantic_text/_bulk
2.  {"index": {"_id": "1"}}
3.  {"content": "阿里巴巴(中国)有限公司成立于2007年03月26日,法定代表人蒋芳"}
4.  {"index": {"_id": "2"}}
5.  {"content": "百度是拥有强大互联网基础的领先AI公司。百度愿景是:成为最懂用户,并能帮助人们成长的全球顶级高科技公司。于2000年1月1日在中关村创建了百度公司"}

`AI写代码

我们写入上面的文档,并做如下的查询:

bash 复制代码
`

1.  GET semantic_text/_search
2.  {
3.    "query": {
4.      "match": {
5.        "inference_field": "阿里是什么样的公司?"
6.      }
7.    }
8.  }

`AI写代码
bash 复制代码
`

1.  GET semantic_text/_search
2.  {
3.    "query": {
4.      "match": {
5.        "inference_field": "What is Baidu company?"
6.      }
7.    }
8.  }

`AI写代码

很显然它天生支持多语言。

有人可能想知道,这个到底是怎么做到的。答案是是它在底层自动使用了 EIS (Elastic Inference Service)。详细的连接步骤,请参考文章 "跳过 MLOps:通过 Cloud Connect 使用 EIS 为自管理 Elasticsearch 提供托管云推理"。

更多详情,请观看视频:

www.bilibili.com/video/BV1BK...

相关推荐
Elasticsearch6 小时前
跳过编写告警规则:NGINX OTel 集成中内置 6 个现成的 ES|QL 模板
elasticsearch
Elasticsearch14 小时前
缩小 AI 差距:下一代知识访问如何为政府解锁任务成果
elasticsearch
Elastic 中国社区官方博客15 小时前
Elasticsearch:搜索教程 - 语义搜索(三)
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
西邮彭于晏1 天前
图文详解:Git分支创建、合并与冲突解决|新手零门槛完整教程
大数据·git·elasticsearch
Elastic 中国社区官方博客1 天前
Elastic 和 OpenAI 合作,将前沿智能引入非结构化企业数据
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai
Elastic 中国社区官方博客1 天前
Elasticsearch:搜索教程 - 全文搜索(一)
大数据·python·elasticsearch·搜索引擎·全文检索
西邮彭于晏1 天前
Git 标签(Tag)与版本发布完整指南|附全场景命令速查表
大数据·git·elasticsearch
Elasticsearch1 天前
Elasticsearch:搜索教程 - 语义搜索(三)
elasticsearch
Elasticsearch1 天前
Elasticsearch:搜索教程 - 向量搜索(二)
elasticsearch
Devin~Y2 天前
从本地生活电商到 AI RAG:互联网大厂 Java 面试场景完整实战
java·spring boot·redis·elasticsearch·spring cloud·kafka·rag