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
Function | Benefit | Impact |
---|---|---|
Data Organization | Structures content for fast access | Faster filter responses |
Facet Storage | Pre-processes facet values | Eliminates real-time calculations |
Search Optimization | Creates searchable data structure | Instant 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
Parameter | Type | Description | Required |
---|---|---|---|
$posts | array | Post IDs to index | No |
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
Scenario | Index Action | Reason |
---|---|---|
New Facets Created | Full rebuild | New data extraction needed |
Content Added/Updated | Automatic or selective | Keep index current |
Facet Sources Changed | Full rebuild | Data structure changed |
Performance Issues | Full rebuild | Optimize 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
Practice | Recommendation | Benefit |
---|---|---|
Timing | Run during low traffic periods | Minimize user impact |
Frequency | After major content changes | Keep data current |
Monitoring | Check for completion | Ensure reliability |
Backup | Before major rebuilds | Recovery option |
Troubleshooting Index Issues
Problem | Symptoms | Solution |
---|---|---|
Incomplete Index | Missing results in filters | Run full index rebuild |
Outdated Results | Old content still appearing | Rebuild index for updated content |
Performance Issues | Slow filter responses | Check index completion status |
Empty Facets | No facet values showing | Verify 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
Action | Purpose | Reference |
---|---|---|
Create Facets | Ensure data sources before indexing | Facets Documentation → |
Test Filters | Verify index is working correctly | Getting Started → |
Monitor Performance | Check system responsiveness | Troubleshooting Guide → |
Pro Tip: After creating new facets or making significant content changes, always rebuild the index to ensure optimal performance and accurate filtering results.