Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 4.0-rc-1, 3.5.1
-
Component/s: Search
-
Labels:None
-
Environment:Windows XP, JRE 1.6, reproduced with the install version (hsql) and war version (PostgreSQL 9.1)
-
keywords:word, doc, docx, attachment, index, lucene
-
Difficulty:Unknown
-
Documentation:N/A
-
Documentation in Release Notes:N/A
-
Similar issues:
XWIKI-6663Lucene index should store document and attachment versions XWIKI-5831Enable preview office feature for all formats supporting by OpenOffice (especially docx, xlsx, pdf, pptx, odf, ods, odp) XWIKI-1877Lucene plugin fails to index some document with attachments XWIKI-298Rollback doesn't work for objects attached to a doc XWIKI-8321 Let the user know when a newer extension version is available XWIKI-2109Can't search page titles with the Lucene plugin XWIKI-6664Lucene rebuilder should also check the document version and language XWIKI-7206Memory leak triggered by Lucene indexing XWIKI-966Document deletion not supported by the Lucene Plugin XWIKI-1735Lucene Plugin does not index creation or modification dates
Description
When a Word is attached to a page, it's content is indexed properly by Lucene. However, after attaching a new version of the same document, only the original version is found. In the sample there are 2 document (both in doc and docx format). The first contains the text "1212", the second contains "3434".
To reproduce the bug, attach test.doc from directory 1212. Search will find the document. Attach test.doc from directory 3434 to the same page. Search will find only 1212, but not 3434.
If I delete the attachment from the page, and reattach test.doc from 3434, then it works correctly: will not found 1212, but will found 3434. (however, versions are lost this way)
This looks like an oversight from when the event API was refactored. The AttachmentUpdatedEvent simply isn't in the list of events that the Lucene index updater listens for:
private static final List<Event> EVENTS = Arrays.<Event> asList(new DocumentUpdatedEvent(), new DocumentCreatedEvent(), new DocumentDeletedEvent(), new AttachmentAddedEvent(), new AttachmentDeletedEvent());