[ 
https://issues.apache.org/jira/browse/JSPWIKI-1131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17228500#comment-17228500
 ] 

FP commented on JSPWIKI-1131:
-----------------------------

Hi [~juanpablo],

I built commit 9406f01b338a643e37ea124ef8d5e794d709859b and was able to 
pinpoint the issue to the use of `VersioningFileProvider` as page provider.
 * The steps below were all executed on the same page: `TestLucene`
 * The data directory only contained the wikipages-de at the start of the test
 * Lucene index was rebuilt before starting the test

||Version before||Action||Version after||Searches||
|–|Create page and add "correct"|1|"correct": ✔|
|1|Add "horse"|2|"correct" ✔ "horse" ✘|
|2|Add "battery"|3|"correct" ✔ "horse" ✔ "battery" ✘|
|3|Add "staple"|4|"correct" ✔ "horse" ✔ "battery" ✔ "staple" ✘|
 * It seems that the indexer does not pick up the latest version of the file 
but the version before. The file TestLucene.txt in JSPWiki's pages directory 
always contains the correct (=latest) version of the page and the corresponding 
files in `OLD/TestLucene` seem to be correct, too.
 * The following debug log entries are recorded when after adding "horse" (= 
row2):

{code:java}
DEBUG org.apache.wiki.WatchDog - JSPWiki Lucene Indexer: Entering state 
Emptying index queue, expected completion in 60 s
DEBUG org.apache.wiki.search.LuceneSearchProvider - Updating Lucene index for 
page 'TestLucene'...
DEBUG org.apache.wiki.search.LuceneSearchProvider - Indexing TestLucene...
DEBUG org.apache.wiki.providers.CachingAttachmentProvider - Listing attachments 
for WikiPage [Wiki:TestLucene,ver=1,mod=Mon Nov 09 11:04:08 CET 2020]
DEBUG org.apache.wiki.providers.CachingAttachmentProvider - LIST from cache, 
TestLucene, size=0
DEBUG org.apache.wiki.search.LuceneSearchProvider - Done updating Lucene index 
for page 'TestLucene'.
DEBUG org.apache.wiki.WatchDog - JSPWiki Lucene Indexer: Exiting state{code}
Some additional notes:
 * Search works as expected, once I switch from `VersioningFileProvider` to 
`FileSystemProvider`
 * The setting `jspwiki.usePageCache` (true in may case) does not change the 
behavior.
 * The setting `jspwiki.lucene.indexdelay` does not change the behavior.

> Lucene Index not updated on edits/new page
> ------------------------------------------
>
>                 Key: JSPWIKI-1131
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-1131
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.11.0-M7
>         Environment: * Debian 10
>  * Tomcat 9: 9.0.31-1~deb10u2
>  * OpenJDK-JRE 11: 11.0.7+10-3~deb10u1
>  * JSPWiki 2.11.0-M7
>            Reporter: FP
>            Priority: Critical
>             Fix For: 2.11.0-M8
>
>         Attachments: exception.txt, illegal-page-name.txt
>
>
> It seems that the lucene search index is not updated when a user edits an 
> existing page or creates a new page. In both cases, the page is not found 
> when someone searches for it.
> Search works as expected when:
>  * Tomcat is stopped
>  * The files in the {{lucene}} directory are removed
>  * Tomcat is started
>  * Wait until the Lucene Indexer thread finishes reindexing
> The following exception occurs when a page is edited (full stack trace 
> attached):
> {{java.io.NotSerializableException: org.apache.wiki.WikiContext}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to