I looked through the documents for the Java version of Lucene, but so far I can’t see information on how this works at the highest level (I know that I need RTFM, I just can "I see a tree for trees".
I understand that Lucene uses search indexes to return results. As far as I know, it only returns “hits” from these indices. If I did not add the data item when creating the index, it will not be returned.
This is good, so now I want to check the following assumption:
Q: Does this mean that any data that I want to display on the search page needs to be added to the Lucene index?
those.
If I want to search for Product with things like sku, description, category name, etc., but I also want to display Customer that they belong in the search results, do the following:
- Make sure the Lucene index has the denormalized
Customer name in the index. - Use Lucene images to somehow query the database for the actual product records and use the
JOIN to get the Customer name.
I assume this is option 1 , as I assume that there is no way to “attach” the Lucene query results to an RDBMS, but I wanted to ask that my general usage assumptions are correct.
source share