GuidePlugin LogoGuidePlugin Docs

Indexing

Learn how to build and manage the GuidePlugin index for optimal search performance.

The GuidePlugin index is the optimized database that enables fast filtering and searching. Understanding how to build and maintain this index is essential for optimal plugin performance.

Index Purpose

FunctionBenefitImpact
Data OrganizationStructures content for fast accessFaster filter responses
Facet StoragePre-processes facet valuesEliminates real-time calculations
Search OptimizationCreates searchable data structureInstant result delivery

Building the Index

The index needs to be built after creating facets and when content changes significantly.

Access Index Management

Navigate to your WordPress admin and find the GuidePlugin indexing options.

Rebuild Complete Index

To rebuild the entire index for all posts:

Method: Use the built-in rebuild functionality When to use: Initial setup, major content changes, facet modifications

Monitor Index Status

Check that the indexing process completes successfully and all content is included.

Programmatic Index Management

For developers, GuidePlugin provides the GuidepluginHelper::build_index() function for programmatic index control.

Function Syntax

GuidepluginHelper::build_index($posts);

Parameters

ParameterTypeDescriptionRequired
$postsarrayPost IDs to indexNo

Parameter Details:

  • If $posts is empty or not provided, all posts will be reindexed
  • If $posts contains specific post IDs, only those posts will be indexed

Usage Examples

Index Specific Posts:

<?php
$posts = array(45, 46, 47);
GuidepluginHelper::build_index($posts);

Index All Posts:

<?php
GuidepluginHelper::build_index();

When to Rebuild Index

ScenarioIndex ActionReason
New Facets CreatedFull rebuildNew data extraction needed
Content Added/UpdatedAutomatic or selectiveKeep index current
Facet Sources ChangedFull rebuildData structure changed
Performance IssuesFull rebuildOptimize data organization

Automatic Indexing: GuidePlugin automatically indexes new and updated content in most cases. Manual rebuilding is mainly needed for facet changes or troubleshooting.

Index Management Best Practices

PracticeRecommendationBenefit
TimingRun during low traffic periodsMinimize user impact
FrequencyAfter major content changesKeep data current
MonitoringCheck for completionEnsure reliability
BackupBefore major rebuildsRecovery option

Troubleshooting Index Issues

ProblemSymptomsSolution
Incomplete IndexMissing results in filtersRun full index rebuild
Outdated ResultsOld content still appearingRebuild index for updated content
Performance IssuesSlow filter responsesCheck index completion status
Empty FacetsNo facet values showingVerify content has required data, rebuild index

Large Sites: On sites with thousands of posts, indexing can take several minutes. Plan accordingly and monitor server resources.

Index Status Monitoring

Signs of Healthy Index

  • Filters show expected options
  • Results appear quickly
  • New content appears in filters
  • Facet values are current

Signs Requiring Index Rebuild

  • Results missing or outdated
  • Slow filter performance
  • Empty facet options
  • Recent content not appearing

Development Integration

For theme and plugin developers integrating with GuidePlugin:

// Hook into post save to trigger selective indexing
add_action('save_post', function($post_id) {
    if (get_post_type($post_id) === 'your_post_type') {
        GuidepluginHelper::build_index(array($post_id));
    }
});

Next Steps

ActionPurposeReference
Create FacetsEnsure data sources before indexingFacets Documentation →
Test FiltersVerify index is working correctlyGetting Started →
Monitor PerformanceCheck system responsivenessTroubleshooting Guide →

Pro Tip: After creating new facets or making significant content changes, always rebuild the index to ensure optimal performance and accurate filtering results.