所以我的问题基本上和这里描述的一样,但是对于小组来说仍然没有答案.
我的映射:
{
"abstract": {
"properties": {
"summary": {
"type": "string"
}
}
},
"authors": {
"type": "nested",
"properties": {
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我想对这两个领域进行全文搜索,可能是不平等的加权.我想到的查询,但不幸的是不起作用,将是这样的:
{
"query": {
"bool": {
"should": [{
"multi_match": {
"query": "higgs boson",
"fields": ["abstract.summary^5", "author.last_name^2"]
}
}]
}
}
}
Run Code Online (Sandbox Code Playgroud)
我没有得到authors字段的任何结果,因为它的嵌套映射.我也无法摆脱嵌套属性 - 我将它用于聚合.任何优雅的想法如何解决?
我访问带有路径的页面/mypage?a=1&b=1&c=1.我想创建一个类似url的链接,一些参数改变了:/mypage?a=1&b=2&c=1,b从1改为2.我知道如何获取当前参数request.args,但结构是不可变的,所以我不知道如何编辑它们.如何使用修改后的查询在Jinja模板中创建新链接?