如何从SOLR结果中排除特定数据?

  • 本文关键字:数据 排除 SOLR 结果 solr
  • 更新时间 :
  • 英文 :


我是SOLR的首次亮相,我在solr中有以下索引数据:

代码
状态
时间戳8fdd04e7 临时 2018-25-09 21:07:10PM 8fdd04e7 临时 2018-25-09 21:17:20PM 8FDD04e7 临时 2018-25-09 21:20:40PM 8fdd04e7 成功 2018-25-09 21:27:30PM 32C313e8 临时 2018-25-09 22:31:30PM f663e6bc 临时 2018-25-09 23:35:20PM f663e6bc 故障 2018-25-09 21:35:50PM d3fe29e7 临时 2018-25-09 21:37:20PM

在这里,我正在寻找那些从未成功失败的代码。我正在寻找的是:

代码
状态
时间戳32c313e8 临时 2018-25-09 22:31:30PM d3fe29e7 临时 2018-25-09 21:37:20PM

可以使用筛选器查询。 使用 fq 参数向 solr 发送请求。

例如 :http://localhost:8983/solr/CORE_NAME/select?q=*:*您可以在 Solr 中获得所有文档

Code Status 8fdd04e7 temporary 8fdd04e7 temporary 8fdd04e7 temporary 8fdd04e7 success 32c313e8 temporary f663e6bc temporary f663e6bc failure d3fe29e7 temporary

在上面的查询中,q=*:*返回所有索引文档(* - 匹配所有文档(。

我们可以过滤结果/文档,以仅使用filterquery参数(fq(获取状态:临时

的文档例如 :http://localhost:8983/solr/CORE_NAME/select?q=*:*&fq=status:temporary

Code Status 8fdd04e7 temporary 8fdd04e7 temporary 8fdd04e7 temporary 32c313e8 temporary f663e6bc temporary d3fe29e7 temporary

更新。

下面的查询将过滤掉状态值为成功或失败的结果

http://localhost:8983/solr/CORE_NAME/select?q=*:*&fq=-status:failure&fq=-status:success

希望这有帮助, 维诺德

最新更新