WP Manifestindependent plugin directory
manifest / utilities / deleuze-search-for-wp

Deleuze Search

Filtered search plugin for Wordpress

by Aldabar · github.com/aldaarita/deleuze-search-for-wp · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/aldaarita/deleuze-search-for-wp/archive/refs/heads/Deleuze-Search-v1.0.1.zip

Build powerful, customizable search forms that allow users to search specific Pods Custom Post Types (and other CPTs) and filter results by associated taxonomies. Features a custom indexer for potentially improved keyword search performance.

Description

Deleuze Search provides a flexible way to create multiple, independent search experiences on your WordPress site, especially useful for sites using Pods or other Custom Post Types (CPTs) and Taxonomies.

Instead of relying solely on the default WordPress search, which searches limited content across all post types, Deleuze Search allows you to configure:

  • Multiple Search Forms: Create different forms for different search needs via a dedicated Custom Post Type.
  • Targeted Post Types: Each form can be configured to search only specific post types (e.g., search only 'Books' and 'Articles', ignoring 'Pages').
  • Taxonomy Filters: Add dropdown filters to your forms based on taxonomies associated with the selected post types (e.g., filter 'Books' by 'Genre' or 'Author').
  • Enhanced Filter Dropdowns: Filter dropdowns support multiple selections using the Select2 library, allowing users to choose several filter options at once.
  • Custom Indexer: Includes a basic custom index table that stores post content for potentially faster keyword searches. Manual rebuilds run reliably in the background using Action Scheduler.
  • Shortcode Integration: Easily display search forms anywhere on your site using a generated shortcode like [deleuze_search id="123"].
  • Configurable Results: Options for setting the number of results per page directly on the search results page.
  • Enhanced Single Post Display: Custom template for single post views with a responsive two-column layout that properly handles Pods custom fields and relationship data.
  • Improved Navigation: Includes a "Back to search results" button for easy navigation between search results and single posts.

This plugin is ideal for sites with structured content where the default search isn't sufficient.

Installation

Requirements:

  • PHP 7.4 or higher
  • WordPress 5.0 or higher
  • Action Scheduler library (available via the standalone Action Scheduler plugin or included with WooCommerce). This is required for background index rebuilding.

Steps:

  1. Upload the deleuze-search folder to the /wp-content/plugins/ directory via FTP or upload the deleuze-search.zip file through the 'Plugins' > 'Add New' > 'Upload Plugin' screen in your WordPress admin area.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Ensure Action Scheduler is active (either via the standalone plugin or WooCommerce).
  4. Navigate to 'Deleuze Search' > 'Settings' to configure the global searchable content.
  5. Navigate to 'Deleuze Search' > 'Add New Form' to create your first search form.

Configuration

After activating the plugin, you need to configure which content should be generally available for searching and filtering:

  1. Go to Deleuze Search > Settings.
  2. Under Searchable Content:
    • Searchable Post Types: Select all the Custom Post Types (including Pods CPTs) that you want to be potentially searchable by any Deleuze Search form. Only post types selected here can be chosen when creating individual forms.
    • Filterable Taxonomies: Select all the taxonomies that you want to be potentially available as filters on any Deleuze Search form.
  3. Under Indexer Settings:
    • Manual Indexing: If Action Scheduler is not detected, a notice will appear prompting you to install it. If it is active, you will see the current indexer status (e.g., Idle, Indexing in progress..., Indexing complete.). Click the "Re-build Index Now" button to schedule a full rebuild of the index in the background. This is recommended after changing searchable post types or making significant content updates.
  4. Click Save Settings.

Usage

Creating a Search Form

  1. Go to Deleuze Search > Add New Form.
  2. Enter a Title for your form (e.g., "Book Search", "Article Filter"). This title is for internal reference.
  3. In the Form Settings meta box:
    • Post Types to Search: Select the specific post types (from those enabled in global settings) that this particular form should search through.
    • Taxonomies to Filter By: Select the specific taxonomies (from those enabled in global settings) that should appear as dropdown filters on this particular form.
  4. Publish the form.

Displaying the Search Form

  1. After publishing a form, find it in the Deleuze Search > All Forms list.
  2. The list table will display the Shortcode for each form (e.g., [deleuze_search id="123"]).
  3. Copy this shortcode.
  4. Paste the shortcode into any page, post, widget, or template file where you want the search form to appear.

How Search Works

  • When a user submits a form, the plugin intercepts the standard WordPress search.
  • It modifies the query to target only the post types configured for that specific form ID.
  • It applies taxonomy filters based on the user's selections in the dropdowns.
  • Multiple selections within each filter are supported, allowing users to search for posts matching any of the selected terms.
  • If keywords were entered, it first attempts to find matching posts in the custom index. If results are found, only those posts are used. If no results are found in the index for the keywords, it falls back to letting WordPress perform its default keyword search (still restricted by the form's post types and taxonomy filters).
  • The results are displayed using your theme's search results template (search.php or equivalent).
  • The search form (including a "Results per page" selector) is automatically displayed above the results on the search results page.

Single Post Display

  • The plugin includes a custom template for displaying single posts from search results.
  • The template features a responsive two-column layout with:
    • Left column: Featured image and back to search button
    • Right column: Post title and all relevant Pods custom fields
  • Automatically handles Pods relationship fields, displaying them as clickable links to related posts
  • Provides fallback methods for complex data types to ensure all content is properly displayed
  • Maintains proper styling and visibility of content on all device sizes

Frequently Asked Questions

  • Does this work with regular Posts and Pages? Yes, as long as 'Posts' and 'Pages' are selected in the global "Searchable Post Types" setting and also selected in the specific Form Settings for the form you are using.

  • Why aren't my theme's header/footer/sidebar customizations showing on the search results page? This can sometimes happen due to how themes handle the is_search() template conditional. We are investigating better compatibility (See Step 14). Using a theme known to be compatible (like Neve or default WordPress themes) is recommended.

  • How often should I rebuild the index? Rebuild the index after significant content updates, or after changing the "Searchable Post Types" in the global settings. The plugin automatically updates the index when individual posts of a searchable type are saved or deleted.

  • Why is the "Re-build Index Now" button disabled? The button is disabled if the background indexing process is currently running or scheduled, or if the required Action Scheduler library is not active. Check the Status message next to the button and ensure Action Scheduler (standalone plugin or via WooCommerce) is installed and active.

  • Can I search custom fields added by Pods? Currently, the keyword search primarily uses the standard post title and content stored in the custom index. Explicit indexing of specific Pods fields is planned for future improvement. Taxonomy filtering works for any Pods taxonomies selected.

  • How does the plugin handle Pods relationship fields? The single post template includes specialized code to properly display Pods relationship fields as clickable links. It uses multiple methods to retrieve relationship data, ensuring compatibility with different Pods configurations.

Screenshots

  1. Deleuze Search global settings page (Settings > Deleuze Search).
  2. Deleuze Search form CPT editor screen showing Form Settings meta box.
  3. Example of a search form displayed on the front-end using the shortcode.
  4. Example of search results page showing filters and results per page selector.
  5. Single post view with responsive two-column layout.

Changelog

1.0.1

  • Added custom single post template with responsive two-column layout
  • Implemented robust handling of Pods relationship fields
  • Added "Back to search results" navigation
  • Improved search results display with proper styling
  • Enhanced taxonomy filters with multiple selection support using Select2
  • Fixed issues with taxonomy terms display
  • Enhanced compatibility with various WordPress themes

1.0.0

  • Initial release.

Upgrade Notice

1.0.1

  • This update adds a custom single post template for improved display of search results and better handling of Pods custom fields. No configuration changes required.

1.0.0

  • Initial release. No specific upgrade steps needed.