To start, let’s create a simple search extractor. The extractor will return all indexed pages for the search term homePage. To create a custom search extractor go to Admin → Search Extractors, click on the Custom search extractor link → Expand examples and select Home Pages Extractor:

Click Add to save the search extractor.

Now choose the search field at the top-right, type homePage : true and search.

The search result returns the list of the home pages for all spaces.

If you want the search result to return all the pages that exist in Confluence, including those created before the extractor, then the Confluence search index has to be rebuilt. For more information on rebuilding the index, read up on Content Index Administration.

Rebuilding the search index is a time consuming, expensive operation and should not be triggered in busy hours.

Binding Variables in Extractor

There are three binding variables available in extractor script. These are:

  • document : The Lucene document that will be added to the search index for the object that is being saved

  • defaultSearchableText : The main body of text associated with this object in the search index

  • searchable : The object that is being saved, and passed through the extractor chain