Is there any way to implement JOINS in Lucene?
相关问题
- SQL join to get the cartesian product of 2 columns
- JCR-SQL - contains function doesn't escape spe
- Query self-join with Sequelize, including related
- Multiple (left, cross?) JOINs in MS Access
- Adding Inner join and where clause to INSERT INTO
相关文章
- Solr - _version_ field must exist in schema and be
- SQL Server 2008: Joining results of STORED PROCEDU
- Join two tables in MySQL, returning just one row f
- Oracle USING clause best practice
- Redshift table update with join
- Join datatables using column names stored in varia
- Deleting using LEFT JOIN
- How to make these JOIN queries?
Use joinutil. It allows query time joins.
See: http://lucene.apache.org/core/4_0_0/join/org/apache/lucene/search/join/JoinUtil.html
A little late but you could use Package org.apache.lucene.search.join : https://lucene.apache.org/core/6_3_0/join/org/apache/lucene/search/join/package-summary.html
From their documentation:
There are some implementations on the top of Lucene that make those kind of joins among several different indexes possible. Numere (http://numere.stela.org.br/) enable that and make it possible to get results as a RDBMS result set.
You can also use the new BlockJoinQuery; I described it in a blog post here:
http://blog.mikemccandless.com/2012/01/searching-relational-content-with.html
Lucene does not support relationships between documents, but a join is nothing else but a specific combination of multiple
AND
within parenthesis, but you will need to flatten the relationship first.Sample (SQL => Lucene):
SQL:
Lucene:
Make sure you have all the neccessary fields and their respective values on the document like: Customer.Name => "Customer_Name" and
Order.Nr => "Order_Nr"
The query would then be:
https://issues.apache.org/jira/browse/SOLR-2272