【问题标题】:SOLR - Combining block join phrase queries using ORSOLR - 使用 OR 组合块连接短语查询
【发布时间】:2017-04-09 13:37:20
【问题描述】:

如何在两个块连接子句之间进行 OR。

例如:我想查找所有包含短语“abc def”或“hij lmn”的父文档

这里假设“abc def”和“hij lmn”在不同的子文档中,并且所有父文档都有一个标识符 doc_type:parent

从逻辑上讲,查询应该是:

({!parent which="doc_type:parent"}"abc def") OR ({!parent which="doc_type:parent"}"hij lmn") .
这个查询会抛出

EOF .org.apache.solr.search.SyntaxError: Cannot parse '\"abc': Lexical 第 1 行第 5 列错误。

遇到:之后:\"\\"abc\""error .

我不能与 fq 结合,因为我这里有一个 OR 运算符。我们如何解决这个问题?

【问题讨论】:

  • 嗨,请您在此处提供完整的查询。
  • 我在问题中发布的相同查询,再次粘贴供您参考:({!parent which="doc_type:parent"}"abc def") OR ({!parent which=" doc_type:parent"}"hij lmn")
  • 您好,答案有更新吗?我很坚持这一点。

标签: solr lucene


【解决方案1】:

在块连接构造之后尝试使用单个空格 例如 ({!parent which="doc_type:parent"} "abc def") OR ({!parent which="doc_type:parent"} "hij lmn")

【讨论】:

  • 这个解决方案可以解决语法问题。但是返回的查询结果是错误的
【解决方案2】:

Yonik Seeley 已在以下链接中回答了此问题 http://comments.gmane.org/gmane.comp.jakarta.lucene.solr.user/95646

为了方便引用答案: ({!parent which="doc_type:parent" v=' "abc def" '}) 要么 ({!parent which="doc_type:parent" v=' "hij lmn" '})

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-12
    相关资源
    最近更新 更多