Search results: draft version is indexed and provided for not logged in user
Now next situation can be received: page accessible for not logged in user was changed and content saved as draft. Not logged in user searched according some new text in this page, page was returned, text was visible in results, but after page was opened - other content was visible. Maybe indexing could be done only for published content (not ok if idea was to use search and for unpublished content) or there should be two versions: one with published content (for not logged in users) and other one including drafts (for logged in users).
As decided with Paulius:
- Create index for each user and one public index
- For getting users, Lucene module should contain event GetAllUsers. Web project (for example, sandbox) should return the list of all the available users (usernames). For example:
LuceneSearch.GetUsers += GetUsers();
UsersList GetUsers()
{
return Membership.GetAllUsers();
}
- Lucene crawler should crawl each page by unauthenticated and authenticated with each user
- Authentication could be done by setting user token from Lucene module and passing it within header. Header should be added to: static list, cache, database
- Lucene module should attach to cms authentication request event, and on request should check if there is a Lucene authentication token in the headers
- If token exists, should check it in such an order: 1. static list (should work when application and crawler are in the same module) 2. cache (when cache is on the same machine) 3. database (when cache is on different machines)
- When token is received, system should set user as user principal. Token should be removed (it may stay in static list, cache, database for a long time)
- Content should go to user's specific cache
- When searching in Lucene should look in specific index
Need to discuss some more, because there is obscurity and many problems may occur when implementing such a model.
Moving to version 2.0