Class ConfluenceDocumentBuilder

  extended by
All Implemented Interfaces:, org.springframework.beans.factory.InitializingBean

public class ConfluenceDocumentBuilder
extends Object
implements, org.springframework.beans.factory.InitializingBean

A Confluence specific implementation of the DocumentBuilder that is aware of plugin's and the fact that new document extractors may become available or unavailable based on the current plugins installed.

Since the BaseDocumentBuilder is immutable when the extractors change a new documentBuilder is created.

Produces documents with of type SearchResultType.CONTENT.

Nested Class Summary
static class ConfluenceDocumentBuilder.FieldName
Field Summary
static String TYPE_FIELD
static String URL_PATH_FIELD
Constructor Summary
ConfluenceDocumentBuilder(com.atlassian.bonnie.HandleResolver handleResolver, com.atlassian.plugin.PluginAccessor pluginAccessor)
ConfluenceDocumentBuilder(com.atlassian.bonnie.HandleResolver handleResolver, com.atlassian.plugin.PluginAccessor pluginAccessor, List<> luceneExtractors)
          Constructor for tests.
Method Summary
 void afterPropertiesSet()
 org.apache.lucene.document.Document getDocument(com.atlassian.bonnie.Searchable searchable)
          Generates a Lucene document using the extractors defined by construction of BaseDocumentBuilder.
 com.atlassian.bonnie.Handle getHandle(Object obj)
protected  org.apache.lucene.document.Document getInitialDocument(com.atlassian.bonnie.Searchable searchable)
          Get the initial document that will be passed through the chain of extractors
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final String TYPE_FIELD
See Also:
Constant Field Values


public static final String URL_PATH_FIELD
See Also:
Constant Field Values
Constructor Detail


public ConfluenceDocumentBuilder(com.atlassian.bonnie.HandleResolver handleResolver,
                                 com.atlassian.plugin.PluginAccessor pluginAccessor)


public ConfluenceDocumentBuilder(com.atlassian.bonnie.HandleResolver handleResolver,
                                 com.atlassian.plugin.PluginAccessor pluginAccessor,
                                 List<> luceneExtractors)
Constructor for tests.

Method Detail


public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean


public org.apache.lucene.document.Document getDocument(com.atlassian.bonnie.Searchable searchable)
Generates a Lucene document using the extractors defined by construction of BaseDocumentBuilder. Note: The 'contentBody' field will only be used if the data is below the value defined by system property 'atlassian.indexing.contentbody.maxsize'. If this property is not defined, threshold will default to 1 MiB.

Specified by:
getDocument in interface
searchable - The object to be processed
a Lucene Document with extracted data from searchable object


protected org.apache.lucene.document.Document getInitialDocument(com.atlassian.bonnie.Searchable searchable)
Get the initial document that will be passed through the chain of extractors

searchable - the object the document is being created for
a new Document pre-filled with the absolute minimum necessary data for it to be added.


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

Copyright © 2003–2015 Atlassian. All rights reserved.