com.xpn.xwiki.plugin.lucene
Class AbstractIndexData

java.lang.Object
  extended by com.xpn.xwiki.plugin.lucene.AbstractIndexData
Direct Known Subclasses:
AbstractDocumentData, WikiData

public abstract class AbstractIndexData
extends Object

Since:
1.23
Version:
$Id$

Constructor Summary
AbstractIndexData(String type, org.xwiki.model.reference.EntityReference entityReference, boolean deleted)
           
 
Method Summary
 void addDataToLuceneDocument(org.apache.lucene.document.Document luceneDoc, com.xpn.xwiki.XWikiContext context)
          Adds this documents data to a lucene Document instance for indexing.
 String getDocumentFullName()
           
 String getDocumentName()
           
 String getDocumentSpace()
           
protected  String getEntityName(org.xwiki.model.EntityType type)
           
 org.xwiki.model.reference.EntityReference getEntityReference()
           
 String getFullName()
           
protected abstract  void getFullText(StringBuilder sb, com.xpn.xwiki.doc.XWikiDocument doc, com.xpn.xwiki.XWikiContext context)
           
 String getFullText(com.xpn.xwiki.doc.XWikiDocument doc, com.xpn.xwiki.XWikiContext context)
           
abstract  String getId()
           
 org.apache.lucene.index.Term getTerm()
           
 String getType()
           
 String getWiki()
           
 boolean isDeleted()
           
 void setDeleted(boolean deleted)
           
 void setEntityReference(org.xwiki.model.reference.EntityReference entityReference)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractIndexData

public AbstractIndexData(String type,
                         org.xwiki.model.reference.EntityReference entityReference,
                         boolean deleted)
Method Detail

addDataToLuceneDocument

public void addDataToLuceneDocument(org.apache.lucene.document.Document luceneDoc,
                                    com.xpn.xwiki.XWikiContext context)
                             throws com.xpn.xwiki.XWikiException
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:

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.
Throws:
com.xpn.xwiki.XWikiException

getId

public abstract String getId()
Returns:
string unique to this document across all languages and virtual wikis

getTerm

public org.apache.lucene.index.Term getTerm()

getFullText

public String getFullText(com.xpn.xwiki.doc.XWikiDocument doc,
                          com.xpn.xwiki.XWikiContext context)
Returns:
String of documentName, documentWeb, author and creator

getFullText

protected abstract void getFullText(StringBuilder sb,
                                    com.xpn.xwiki.doc.XWikiDocument doc,
                                    com.xpn.xwiki.XWikiContext context)

getType

public String getType()

setDeleted

public void setDeleted(boolean deleted)
See Also:
isDeleted()

isDeleted

public boolean isDeleted()
Returns:
indicate of the element should be deleted from he index

getEntityReference

public org.xwiki.model.reference.EntityReference getEntityReference()

setEntityReference

public void setEntityReference(org.xwiki.model.reference.EntityReference entityReference)

getEntityName

protected String getEntityName(org.xwiki.model.EntityType type)

getDocumentName

public String getDocumentName()

getDocumentSpace

public String getDocumentSpace()

getWiki

public String getWiki()

getDocumentFullName

public String getDocumentFullName()

getFullName

public String getFullName()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2011 XWiki. All Rights Reserved.