我是 .net core 的新手。我使用https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/nest.html作为我的弹性搜索客户端。
我有以下用弹性搜索编写的查询:
{
"query": {
"bool":{
"must":[
{
"term":{
"bookId.keyword":"c962ec04-6d25-4823-8e78-6d99d4072032"
}
},
{
"bool":{
"should":[
{
"match_phrase":{
"text":"Plants"
}
}
]
}
}
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
虽然我的 NEST 代码是:
{
"query": {
"bool":{
"must":[
{
"term":{
"bookId.keyword":"c962ec04-6d25-4823-8e78-6d99d4072032"
}
},
{
"bool":{
"should":[
{
"match_phrase":{
"text":"Plants"
}
}
]
}
}
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是我无法得到预期的结果。谁能帮我这个?