This is my initial design.
The Lucene table will contain only 2 types of records: users and topics (threads). A topic record will contain a "content" field which will contain the Luan needed to construct the topic. This will include constructing the array of posts in the topic. Posts will be Luan objects but will not have records in Lucene. All searches will be against topics, not posts.
Forums will be defined in Luan config files. The forum ID will just be a unique string. Each topic will be in a forum and the lucene record of the topic will have a "forum" field containing the forum ID. Forums are independent from each other. There is no forum hierarchy. So one can list topics in a forum or all topics.
The home page of most boards (a board is a forum site) shows a hierarchical list of forums. I will support this but it is purely aesthetic and has no meaning. Suppose I have an animal board with a home page like this:
animals
mammals
dogs
cats
reptiles
lizards
snakes
Only the leaf nodes (dogs, cats, lizards, snakes) should be forums. The other things are just categories and shouldn't be clickable. If you want more general forums, do this:
animals
general animals
mammals
general mammals
dogs
cats
reptiles
general reptiles
lizards
snakes
This structure of categories and forums will be stored in a config file and won't be in the lucene db and won't have much impact on the code.
I think this is a very simple design which does everything that a basic forum needs. Hugo, comments?