我是初学者到lucene。现在我因搜索问题而被阻止。我们正在开发一个API,将lucene用作我们应用程序的搜索引擎,并且必须在加入不同条件时进行大量查询。如何通过AND操作链接/连接多个Lucene文档
我们将许多实体作为单独文档存储在lucene中。
每个实体都是作为记录的数量来存储到lucene中作为单独的文档。下面增加一个样本结构的数据,
序列号。 1 - > 16是文档到lucene。
1) "id": "1","sendr_name": "**sender1**", "recip_name": "**recipient1**", "subject": "**subject1**"
2) "id": "1","attachment": "**attachment1**"
3) "id": "1","domain": "**domain1**", "ip": "ip1"
5) "id": "1","mid": "**mid1**"
6) "id": "1","type": "type1"
7) "id": "2","sendr_name": "sender1", "recip_name": "recipient1", "subject": "subject1"
8) "id": "2","attachment": "attachment2"
9) "id": "2","domain": "domain1", "ip": "ip2"
10) "id": "2","mid": "mid2"
11) "id": "2","type": "type2"
12) "id": "3","sendr_name": "sender1", "recip_name": "recipient3", "subject": "subject3"
13) "id": "3","attachment": "attachment3"
14) "id": "3","domain": "domain1", "ip": "ip3"
15) "id": "3","mid": "mid3"
16) "id": "3","type": "type3"
注:序列号。 1-16是不同实体的文档,“id”是内部生成的,所以id值不能作为用户的查询值。
我的需求是提取特定条件下的特定实体或实体。
+sendr_name:sender1 + recip_name:recipient1 +subject:subject1 +attachment:attachment1 +domain:domain1 +mid:mid1
这是获取实体信息(1-6实体文档)。
但上述查询未能返回结果,因为附件,中间和域在不同的文档中。
有没有什么办法可以跨越多个文档?或者无论如何,我们可以加入像doc1.id = doc2.id这样的字段上的查询?
我要求大家提供建议或帮助解决此问题。它不建议
有人可以帮忙吗? –
您使用的是elasticsearch或原始Lucene API吗? –
我只使用原始Lucene API。 –