Index: DocumentData.java =================================================================== --- DocumentData.java (revision 1928) +++ DocumentData.java (working copy) @@ -24,6 +24,8 @@ import com.xpn.xwiki.XWikiContext; import com.xpn.xwiki.doc.XWikiDocument; +import org.apache.lucene.document.Document; +import org.apache.lucene.document.Field; /** * Holds all data but the content of a wiki page to be indexed. The content is @@ -61,4 +63,15 @@ .toString (); } + + public void addDataToLuceneDocument(Document luceneDoc, XWikiDocument doc, XWikiContext context) { + super.addDataToLuceneDocument(luceneDoc, doc, context); + + String dateToIndex; + // Modification Date not null + if (doc.getDate() != null) { + dateToIndex = DateUtility.getDateString(doc.getDate().toString(), DateUtility.DATE_FORMAT_ONE); + luceneDoc.add(new Field(IndexFields.DOCUMENT_DATE, dateToIndex, Field.Store.YES, Field.Index.TOKENIZED)); + } + } } Index: IndexData.java =================================================================== --- IndexData.java (revision 1928) +++ IndexData.java (working copy) @@ -100,12 +100,14 @@ if (wiki != null && wiki.length () > 0) luceneDoc.add (new Field (IndexFields.DOCUMENT_WIKI, wiki, Field.Store.YES, Field.Index.TOKENIZED)); if (getType () != null) luceneDoc.add (new Field (IndexFields.DOCUMENT_TYPE, getType (), Field.Store.YES, Field.Index.TOKENIZED)); - if (modificationDate != null) + if (modificationDate != null){ luceneDoc.add (new Field(IndexFields.DOCUMENT_DATE, IndexFields .dateToString (modificationDate), Field.Store.YES, Field.Index.NO)); - if (creationDate != null) + } + if (creationDate != null){ luceneDoc.add (new Field(IndexFields.DOCUMENT_CREATIONDATE, IndexFields .dateToString (creationDate), Field.Store.YES, Field.Index.NO)); + } // stored Text fields: tokenized and indexed luceneDoc.add (new Field(IndexFields.DOCUMENT_NAME, documentName, Field.Store.YES, Field.Index.TOKENIZED)); Index: IndexFields.java =================================================================== --- IndexFields.java (revision 1928) +++ IndexFields.java (working copy) @@ -23,6 +23,7 @@ import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Calendar; import org.apache.commons.lang.time.FastDateFormat; import org.apache.log4j.Logger; Index: ObjectData.java =================================================================== --- ObjectData.java (revision 1928) +++ ObjectData.java (working copy) @@ -25,6 +25,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Date; import org.apache.log4j.Logger; import org.apache.lucene.document.Field; @@ -37,6 +38,7 @@ import com.xpn.xwiki.objects.classes.BaseClass; import com.xpn.xwiki.objects.classes.ListItem; import com.xpn.xwiki.objects.classes.StaticListClass; +import com.xpn.xwiki.objects.classes.DateClass; /** * Hold the property values of the XWiki.ArticleClass Objects. @@ -154,6 +156,8 @@ if (prop instanceof StaticListClass && ((StaticListClass)prop).isMultiSelect()) { indexStaticList(luceneDoc, baseObject, (StaticListClass) prop, propertyName, context); + } else if (prop instanceof DateClass) { + indexDateProperty(luceneDoc, baseObject, (DateClass) prop, propertyName, context); } else { final String ft = getContentAsText(baseObject, propertyName); if (ft != null) { @@ -163,6 +167,14 @@ } } + private void indexDateProperty(org.apache.lucene.document.Document luceneDoc, BaseObject baseObject, DateClass prop, String propertyName, XWikiContext context) { + Date date = baseObject.getDateValue(propertyName); + String fieldFullName = baseObject.getClassName() + "." + propertyName; + String dateToIndex = null; + dateToIndex = DateUtility.getDateString(date.toString(), DateUtility.DATE_FORMAT_ONE); + luceneDoc.add(new Field(fieldFullName, dateToIndex, Field.Store.YES, Field.Index.TOKENIZED)); + } + private void indexStaticList(org.apache.lucene.document.Document luceneDoc, BaseObject baseObject, StaticListClass prop, String propertyName, XWikiContext context) { Map possibleValues = prop.getMap(context); List keys = baseObject.getListValue(propertyName); Index: textextraction/MSPowerPointTextExtractor.java =================================================================== --- textextraction/MSPowerPointTextExtractor.java (revision 1928) +++ textextraction/MSPowerPointTextExtractor.java (working copy) @@ -8,6 +8,7 @@ package com.xpn.xwiki.plugin.lucene.textextraction; import org.apache.poi.hslf.extractor.PowerPointExtractor; +import org.apache.poi.poifs.filesystem.POIFSFileSystem; import java.io.ByteArrayInputStream; @@ -17,7 +18,8 @@ public class MSPowerPointTextExtractor implements MimetypeTextExtractor { public String getText(byte[] data) throws Exception { - PowerPointExtractor ppe = new PowerPointExtractor(new ByteArrayInputStream(data)); + POIFSFileSystem poiFs = new POIFSFileSystem(new ByteArrayInputStream(data)); + PowerPointExtractor ppe = new PowerPointExtractor(poiFs); return ppe.getText(true, true); } } Index: TextExtractor.java =================================================================== --- TextExtractor.java (revision 1928) +++ TextExtractor.java (working copy) @@ -47,15 +47,10 @@ textExtractors.put ("text/xml", xmlTextExtractor); textExtractors.put ("text/plain", new PlainTextExtractor()); textExtractors.put ("application/pdf", new PDFTextExtractor()); -// textExtractors.put ("application/vnd.sun.xml.writer", new OpenOfficeTextExtractor ()); + textExtractors.put ("application/vnd.sun.xml.writer", new OpenOfficeTextExtractor ()); textExtractors.put ("application/msword", new MSWordTextExtractor ()); - textExtractors.put ("application/ms-word", new MSWordTextExtractor ()); - textExtractors.put ("application/vnd.msword", new MSWordTextExtractor ()); - textExtractors.put ("application/vnd.ms-word", new MSWordTextExtractor ()); - textExtractors.put ("application/vnd.ms-powerpoint", new MSPowerPointTextExtractor()); - textExtractors.put ("application/ms-powerpoint", new MSPowerPointTextExtractor()); textExtractors.put ("application/ms-excel", new MSExcelTextExtractor()); - textExtractors.put ("application/vnd.ms-excel", new MSExcelTextExtractor()); + textExtractors.put ("application/ms-powerpoint", new MSPowerPointTextExtractor()); } /**