I'd like to implement a filter/search feature in my application using Lucene.
Querying Lucene index gives me a Hits
instance, which is nothing more than a list of Document
s matching my criteria.
Since I generate the indexed Document
s from my objects, which is the best way to find the original object related to a specific Lucene Document
?
A better description of my situation:
- Three model classes for now: Folder
(can have other Folder
s or List
s as children), List
(can have Task
s as children) and Task
(can have other Task
s as children). They are all DefaultMutableTreeNode
subclasses. I'll add the Tag
entity in the future.
- Each Task
has a text, a start date, a due date, some boolean flags.
- They are displayed in a JTree
.
- The hole tree is saved in an XML file.
- I'd like to do things like these:
* search Task
s with Google-like queries.
* Find all Task
s that start today.
* Filter Task
s by Tag
.