0
我有以下查询:ElasticSearch过滤器升压的字段值
{
"from": 0,
"query": {
"custom_filters_score": {
"filters": [
{
"boost": 1.5,
"filter": {
"term": {
"format": "test1"
}
}
},
{
"boost": 1.5,
"filter": {
"term": {
"format": "test2"
}
}
}
],
"query": {
"bool": {
"must": {
"query_string": {
"analyzer": "query_default",
"fields": [
"title^5",
"description^2",
"indexable_content"
],
"query": "blah"
}
},
"should": []
}
}
}
},
"size": 50
}
其中需要提高的东西,在他们{"format":"test1"}
,如果我正确地阅读文档。
但是,使用explain
告诉我"custom score, no filter match, product of:"
是结果,并且匹配过滤器的返回文档的分数不会被此过滤器更改。
我在做什么错?
编辑:这里的模式:
mapping:
edition:
_all: { enabled: true }
properties:
title: { type: string, index: analyzed }
description: { type: string, index: analyzed }
format: { type: string, index: not_analyzed, include_in_all: false }
section: { type: string, index: not_analyzed, include_in_all: false }
subsection: { type: string, index: not_analyzed, include_in_all: false }
subsubsection: { type: string, index: not_analyzed, include_in_all: false }
link: { type: string, index: not_analyzed, include_in_all: false }
indexable_content: { type: string, index: analyzed }
,让我们假设一个典型的文件是这样的:
{
"format": "test1",
"title": "blah",
"description": "blah",
"indexable_content": "keywords here",
"section": "section",
"subsection": "child-section",
"link":"/section/child-section/blah"
}
我已经更新了我的问题,包括架构和编辑的示例文档,如果这改变了任何东西。 –
我已经用您提供的信息更新了要点。它仍然有效。我用0.20.2测试了它。所以,我猜想你要么编辑了一些重要的信息,要么就是使用了一些老版本的elasticsearch,这些功能被破坏了。你可以创建一个完全不重要的repro吗? – imotov
原来我是个白痴,索引没有加载。查询确实起作用了! –