Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
<img src="//i.stack.imgur.com/RUiNP.png" height="16" width="18" alt="" class="sponsor tag img">elasticsearch 使用自定义分析器跳过对空字符串的索引_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Lucene_Analyzer_Stop Words_Inverted Index - Fatal编程技术网 elasticsearch 使用自定义分析器跳过对空字符串的索引,elasticsearch,lucene,analyzer,stop-words,inverted-index,elasticsearch,Lucene,Analyzer,Stop Words,Inverted Index" /> elasticsearch 使用自定义分析器跳过对空字符串的索引,elasticsearch,lucene,analyzer,stop-words,inverted-index,elasticsearch,Lucene,Analyzer,Stop Words,Inverted Index" />

elasticsearch 使用自定义分析器跳过对空字符串的索引

elasticsearch 使用自定义分析器跳过对空字符串的索引,elasticsearch,lucene,analyzer,stop-words,inverted-index,elasticsearch,Lucene,Analyzer,Stop Words,Inverted Index,这是我的自定义分析器 "analysis": { "analyzer": { "just_lowercase": { "type": "custom", "tokenizer": "keyword", "filter": ["lowercase"] } } } 我想忽略所有为空字符串或空字符串的字段。我理解这是标准分析仪的默认行为;如何在自定义分析器中重现该行为 更新的问题:我希望此行为:字段上存在的查询(通过仅小写字母分析)不得返回任何具有空值或空字符串值的文档。可能吗 更新

这是我的自定义分析器

"analysis": {
  "analyzer": {
    "just_lowercase": { "type": "custom", "tokenizer": "keyword", "filter": ["lowercase"] }
  }
}
我想忽略所有为空字符串或空字符串的字段。我理解这是标准分析仪的默认行为;如何在自定义分析器中重现该行为

更新的问题:我希望此行为:字段上存在的查询(通过
仅小写字母分析)不得返回任何具有空值或空字符串值的文档。可能吗

更新编号2:以下是我的新想法:我尝试使用带有stopword过滤器的自定义分析器跳过对空字符串的索引,但它不起作用。使用Elastic Search 2.2进行这些设置后,我希望找不到任何文档,而是同时找到这两个文档


在这里您可以找到我的分析器、文档和查询。它与Sense(Chrome Plugin for ES)一起工作。

什么是忽略?我的意思是,该字段上存在的查询不能返回任何具有空值或空字符串值的文档,以及是什么让您认为分析器正在改变空字段的索引方式?你有这样的测试用例吗?我在某个地方读到关于标准分析器的这种行为;现在我自己试过了,发现这不是标准分析仪的行为。我会更新我的问题。谢谢@andrestefani我不认为你可以在分析器中做任何事情来影响这一点。该列表列出了一些情况,在这些情况下,即使分析器根本没有发出令牌,它仍然被视为存在。似乎只有在分析前字段的值为null时,exists查询才不匹配。