做自我加入hibernate-search

时间:2013-05-30 15:26:07

标签: hibernate-search self-join

我有一个关于hibernate搜索的问题(或lucene,它是在幕后)。

说我有这样一张桌子:

  • ... ID..WHO..ITEM ...价格
  • 001 | joey | ipod | 100.00
  • 002 | joey | .....电视| 200.00

我希望能够找到一个以100美元购买ipod的人和200美元的电视。 即用户输入类似“item = ipod price = 100 item = tv price = 200”的内容,它将返回“joey”以及商品/价格详情。

在sql中就像是......

   select * from tbl a
    join tbl b 
    on a.PERSON_ID = b.PERSON_ID
    where (a.item='ipod' and a.price='100.00') 
    and (b.item='tv' and b.price='200.00');

无论如何都在hibernate search / lucene中执行此操作?

1 个答案:

答案 0 :(得分:0)

简短的回答是HSearch / Lucene中没有自加入功能。您可以在此处找到更多信息 - JOINS in Lucene