gpt4 book ai didi

c# - 具有两个短语的多阶段方法 - Elasticsearch

转载 作者:太空宇宙 更新时间:2023-11-03 23:17:59 25 4
gpt4 key购买 nike

我有一段说

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

现在我想为这个段落使用两个短语的匹配短语。

1.simply dummy text of the printing

2.make a type specimen book

Elasticsearch 查询应该检查这两个短语是否出现在段落中并返回答案。我怎样才能做到这一点?

提前致谢。

我对代码的看法:

{
"query": {
"match_phrase": {
"paragraph": {
"query": {"simply dummy text of the printing","make a type specimen book"}
}
}
}
}

这是正确的做法吗??

最佳答案

“AND”类条件:

{
"query": {
"bool": {
"must": [
{
"match_phrase": {
"paragraph": "simply dummy text of the printing"
}
},
{
"match_phrase": {
"paragraph": "make a type specimen book"
}
}
]
}
}
}

“或”类条件:

{
"query": {
"bool": {
"should": [
{
"match_phrase": {
"paragraph": "simply dummy text of the printing"
}
},
{
"match_phrase": {
"paragraph": "make a type specimen book"
}
}
]
}
}
}

关于c# - 具有两个短语的多阶段方法 - Elasticsearch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36616107/

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