public class

ChangeDocumentIndexPolicy

extends Object
java.lang.Object
   ↳ com.atlassian.confluence.search.lucene.ChangeDocumentIndexPolicy

Class Overview

Policy that defines what com.atlassian.bonnie.Searchables should be indexed as change documents.

Summary

Nested Classes
class ChangeDocumentIndexPolicy.PolicyCheckResult  
Public Constructors
ChangeDocumentIndexPolicy()
Public Methods
static ChangeDocumentIndexPolicy.PolicyCheckResult buildFor(Searchable searchable)
Defines the conditions which must be met before a change document will be constructed for the specified searchable.
static boolean shouldIndex(Searchable searchable)
Returns true if this searchable should be indexed as a change, false otherwise.
static boolean shouldUnIndex(Searchable searchable)
Whether we should unindex this searchable.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ChangeDocumentIndexPolicy ()

Public Methods

public static ChangeDocumentIndexPolicy.PolicyCheckResult buildFor (Searchable searchable)

Defines the conditions which must be met before a change document will be constructed for the specified searchable.

These are:

  • Must be instanceof ContentTypeAware
  • Must be a Page, BlogPost, Comment, Attachment, PersonalInformation, SpaceDescription, UserStatus.
  • If Versioned, the latest version must return true for isIndexable().
Parameters
searchable the searchable
Returns
  • the policy check result

public static boolean shouldIndex (Searchable searchable)

Returns true if this searchable should be indexed as a change, false otherwise.

Parameters
searchable the searchable
Returns
  • true if this searchable should be indexed as a change, false otherwise.

public static boolean shouldUnIndex (Searchable searchable)

Whether we should unindex this searchable. The condition to unindex a searchable is more lenient than indexing, as our main objective here is to ensure we are queuing a list of unindex jobs that make sense. It is sufficient in this case to just check that changes are indexed for the persistent class of the searchable. (The criteria we use for indexing a searchable cannot be re-used for unindexing, since the deletion of a searchable may change its state causing it to fail this criteria. Failing our indexing criteria is no reason at all to not unindex.

Parameters
searchable the searchable
Returns
  • true if we should unindex this searchable, false otherwise.