Hi, Following are details of my problem and possible solutions which I can think of. Please suggest which should I choose, or is there any other approach better than these.
I want to index blog posts and their comments, in my database posts and comments are stored in two different tables. Currently I am indexing posts only and search works perfectly fine, but now I want to index comments as well. From now on when user will search any word, all posts will be displayed which meet search criteria including posts and only those comments which meet the specified criteria along with posts. All paging is done on posts, comments are not considered while calculating page contents. e.g. POST => Google launched Chrome Browser COMMENT => Microsoft IE also has tab browsing. Now searching (microsoft AND IE), should also display this post with along with above comment. One solution is: I should index both posts+comments in one lucene index and search that index. But as i have to display 10 posts (not including comments) per page so it gets complicated while finding records to be displayed on any given page. I think, I can solve this problem by creating two queries one to search posts and one to search comments only and then can join them using OR operator. Second solution could be: I can store comments in different index, and on search first I will execute query on comments index and use result of comments search to search blog posts. Thanks in advance. - deve