com.xpn.xwiki.plugin.lucene
Class DocumentData

java.lang.Object
  extended by com.xpn.xwiki.plugin.lucene.IndexData
      extended by com.xpn.xwiki.plugin.lucene.DocumentData

public class DocumentData
extends IndexData

Holds all data but the content of a wiki page to be indexed. The content is retrieved at indexing time, which should save us some memory especially when rebuilding an index for a big wiki.

Version:
$Id: DocumentData.java 29723 2010-06-24 16:45:59Z tmortagne $

Constructor Summary
DocumentData(com.xpn.xwiki.doc.XWikiDocument doc, com.xpn.xwiki.XWikiContext context)
           
 
Method Summary
 void addDataToLuceneDocument(org.apache.lucene.document.Document luceneDoc, com.xpn.xwiki.doc.XWikiDocument doc, com.xpn.xwiki.XWikiContext context)
          Adds this documents data to a lucene Document instance for indexing.
protected  void getFullText(java.lang.StringBuilder sb, com.xpn.xwiki.doc.XWikiDocument doc, com.xpn.xwiki.XWikiContext context)
           
 java.lang.String getType()
           
 
Methods inherited from class com.xpn.xwiki.plugin.lucene.IndexData
buildQuery, getCreationDate, getCreator, getDocumentFullName, getDocumentName, getDocumentSpace, getDocumentTitle, getDocumentWeb, getFullName, getFullText, getId, getLanguage, getWiki, setAuthor, setCreationDate, setCreator, setDocumentFullName, setDocumentName, setDocumentSpace, setDocumentTitle, setDocumentWeb, setFullName, setLanguage, setModificationDate, setWiki, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentData

public DocumentData(com.xpn.xwiki.doc.XWikiDocument doc,
                    com.xpn.xwiki.XWikiContext context)
Method Detail

getType

public java.lang.String getType()
Specified by:
getType in class IndexData
See Also:
IndexData.getType()

getFullText

protected void getFullText(java.lang.StringBuilder sb,
                           com.xpn.xwiki.doc.XWikiDocument doc,
                           com.xpn.xwiki.XWikiContext context)
Overrides:
getFullText in class IndexData

addDataToLuceneDocument

public void addDataToLuceneDocument(org.apache.lucene.document.Document luceneDoc,
                                    com.xpn.xwiki.doc.XWikiDocument doc,
                                    com.xpn.xwiki.XWikiContext context)
Description copied from class: IndexData
Adds this documents data to a lucene Document instance for indexing.

Short introduction to Lucene field types

Which type of Lucene field is used determines what Lucene does with data and how we can use it for searching and showing search results:

Overrides:
addDataToLuceneDocument in class IndexData
Parameters:
luceneDoc - if not null, this controls which translated version of the content will be indexed. If null, the content in the default language will be used.


Copyright © 2004-2010 XWiki. All Rights Reserved.