com.atlassian.confluence.search.lucene
Class ChangeDocumentBuilder

java.lang.Object
  extended by com.atlassian.confluence.search.lucene.ChangeDocumentBuilder
All Implemented Interfaces:
com.atlassian.bonnie.search.DocumentBuilder

public class ChangeDocumentBuilder
extends java.lang.Object
implements com.atlassian.bonnie.search.DocumentBuilder

Builds a change index document from a historical version of a searchable object.

Produces documents of type SearchResultType.CHANGE.


Nested Class Summary
static class ChangeDocumentBuilder.FieldName
           
 
Constructor Summary
ChangeDocumentBuilder(com.atlassian.bonnie.HandleResolver handleResolver, com.atlassian.plugin.PluginAccessor pluginAccessor)
          Constructs a change document builder.
 
Method Summary
 org.apache.lucene.document.Document getDocument(com.atlassian.bonnie.Searchable searchable)
           
 com.atlassian.bonnie.Handle getHandle(java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeDocumentBuilder

public ChangeDocumentBuilder(com.atlassian.bonnie.HandleResolver handleResolver,
                             com.atlassian.plugin.PluginAccessor pluginAccessor)
Constructs a change document builder.

Parameters:
handleResolver - Handle resolver object
pluginAccessor - Plugin accessor object
Throws:
java.lang.IllegalArgumentException - if handleResolver is null
Method Detail

getDocument

public org.apache.lucene.document.Document getDocument(com.atlassian.bonnie.Searchable searchable)
Specified by:
getDocument in interface com.atlassian.bonnie.search.DocumentBuilder
Parameters:
searchable - the searchable
Returns:
a well formed document representing this searchable
Throws:
java.lang.IllegalArgumentException - if the searchable does not contain a valid title/name or the no handle could be determined for the specified searchable using getHandle(Object).
java.lang.UnsupportedOperationException - if the searchable passed in is not a page, blogpost, attachment or comment

getHandle

public com.atlassian.bonnie.Handle getHandle(java.lang.Object obj)
Specified by:
getHandle in interface com.atlassian.bonnie.search.DocumentBuilder


Copyright © 2003-2014 Atlassian. All Rights Reserved.