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 Documents matching my criteria.
Since I generate the indexed Documents 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 Folders or Lists as children), List (can have Tasks as children) and Task (can have other Tasks 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 Tasks with Google-like queries.
* Find all Tasks that start today.
* Filter Tasks by Tag.