2015-07-10 48 views
0

我使用內部聯接Solr中及以下的查詢我工作得很好:{!從= _id加盟= relationships.collection2.key的fromIndex = collection2_shard1_replica1緩存=真}Solr中內使用查詢連接

_id:{!join from = _id to = relationships.collection3.key fromIndex = collection3_shard1_replica1 cache = true} name:「cloudProducts」

現在,我試圖使用IN查詢名稱條件,如name :(「cloudProducts 「或」mobileStation「或」standalone「),因此我將我的查詢設爲:

{!join from = _id to = relationships.covered.targets.key fromIndex = ap p.coveredassets_shard1_replica1 cache = true} _id:{!join from = _id to = relationships.product.targets.key fromIndex = app.products_shard1_replica1 cache = true} str_extensions.tenant.lineOfBusiness.value.name :(「cloudProducts」or「mobileStation 「或‘獨立’)

但它給出瞭解析異常。我試圖操縱語法,但沒有成功。是否有可能在Solr內部連接中使用IN查詢?誰能幫我這個?

+0

如果你有默認的操作符爲OR,那麼你可以給這個查詢作爲 - name :('cloudProducts''mobileStation''standAlone')。您能否提供例外的詳細信息 –

+0

否,或者不是默認運營商 – user3648827

+0

「str_extensions.tenant.lineOfBusiness.value」這是什麼值?......它是「名稱」的前綴?......它不存在前面的查詢... –

回答

0

我能夠通過將內部查詢以「V」關鍵字裏面的內連接來解決這個問題。

{!join from = _id to = relationships.covered.targets.key fromIndex = app.coveredassets_shard1_replica1 cache = true} _id:{!join from = _id to = relationships.product.targets.key fromIndex = app.products_shard1_replica1緩存=真正的v = str_extensions.tenant.lineOfBusiness.value.name :(「cloudProducts」 或 「mobileStation」 或 「獨立」)}

OR

可以使用v = $ innerQuery和傳遞的價值Solr params中的內部查詢。

{!join from = _id to = relationships.covered.targets.key fromIndex = app.coveredassets_shard1_replica1 cache = true} _id:{!join from = _id to = relationships.product.targets.key fromIndex = app.products_shard1_replica1緩存=真正的v = $ innerQuery}

PARAMS: DISTRIB =假& innerJoinQuery1 = str_extensions.tenant.lineOfBusiness.value.name :(「cloudProducts」 或 「mobileStation」 或 「獨立」)