=== CelerSearch ===
Contributors: darkog, celersearch
Tags: search, meilisearch, typesense, instant search, autocomplete
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.1
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Extends WordPress search with a powerful MeiliSearch integration for lightning-fast, typo-tolerant search results.

== Description ==

CelerSearch supercharges your WordPress search by integrating with MeiliSearch, providing instant, typo-tolerant search results that your users will love.

= Search Features =

* **Lightning Fast** - Search results in milliseconds powered by MeiliSearch
* **Typo Tolerant** - Find results even with spelling mistakes
* **Search Highlighting** - Matching terms highlighted in results
* **Autocomplete** - Instant search suggestions as users type
* **Taxonomy Filtering** - Filter by categories, tags, and custom taxonomies
* **Fallback Support** - Falls back to native WordPress search if needed

= Index Types =

* **Posts Index** - Index any post type (posts, pages, custom post types)
* **Products Index** - Full WooCommerce product support including variations
* **Orders Index** - Search WooCommerce orders by customer, email, or order details

= Sync & Indexing =

* **Real-time Sync** - Content changes automatically synced to search index
* **Batch Indexing** - Configurable batch size for large sites
* **Meta Watching** - Re-index when specific meta fields change
* **Manual Rebuild** - One-click index rebuild from admin

= Search Areas =

* **Frontend Search** - Replace main site search
* **Admin Search** - Enhance posts/products list search in wp-admin
* **REST API Search** - Power headless/decoupled WordPress setups

= Developer Friendly =

* **40+ Filter Hooks** - Customize every aspect of indexing and search
* **Configurable Attributes** - Control searchable, filterable, and sortable fields
* **Custom Index Types** - Extend with your own index implementations
* **Modern Admin UI** - Built with Vue 3 and Tailwind CSS

= Documentation =

Full documentation available at [docs.celersearch.com](https://docs.celersearch.com)

= Requirements =

* WordPress 6.0 or higher
* PHP 8.1 or higher
* A MeiliSearch server (self-hosted or managed)

= Getting Started =

1. Install and activate the plugin
2. Go to CelerSearch > Services and add your MeiliSearch server
3. Create an index under CelerSearch > Indices
4. Configure search areas in CelerSearch > Settings
5. Rebuild your index and start searching!

== Installation ==

1. Upload the `celersearch` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Configure your MeiliSearch service under CelerSearch > Services
4. Create indices and configure search areas

== Frequently Asked Questions ==

= Do I need my own MeiliSearch server? =

Yes, CelerSearch requires a MeiliSearch server. You can self-host it or use a managed hosting provider.

= Does it work with WooCommerce? =

Yes! CelerSearch includes a dedicated Products index type that works seamlessly with WooCommerce.

= Will it slow down my site? =

No. CelerSearch offloads search queries to your MeiliSearch server, which typically responds in under 50ms.

= What happens if MeiliSearch is unavailable? =

If configured, CelerSearch can fall back to native WordPress search to ensure your site always has working search functionality.

= Can I disable content splitting for large posts? =

CelerSearch automatically splits long post content into smaller chunks so the entire content is searchable. Meilisearch deduplicates results so each post appears only once. To disable splitting, add this to your `wp-config.php`:

`define( 'CELERSEARCH_SPLIT_POSTS', false );`

You can also customize the chunk size (default 2000 characters):

`define( 'CELERSEARCH_CONTENT_MAX_SIZE', 3000 );`

After changing these settings, rebuild your indices from CelerSearch > Indices.

= How can I replace the default search results page? =

You can replace the default WordPress search results page with a fully customized CelerSearch-powered page in three steps:

1. **Create a View** – Go to CelerSearch > Views and create a new View. Select the index you want to search, configure the search behavior, display options, and filters to your liking.
2. **Create a Page** – Create a new WordPress page (e.g., "Search") and embed the View using the CelerSearch block (in the block editor) or the `[celersearch]` shortcode.
3. **Configure the Search Area** – Go to CelerSearch > Settings > Search Areas. Add or edit the "WordPress Public Search" area, enable "Replace Search Results Page", and select the page you created in step 2. Once enabled, all default WordPress search requests will redirect to your custom search page.

== Screenshots ==

1. Indices management page
2. Service configuration
3. Settings and search areas
4. View Configuration
5. Autocomplete search box

== Changelog ==

= 1.3.0 =

* Fix: Ensure Meilisearch indexes are created with correct primary key and settings before first sync
* Fix: Provision index with filterable attributes on creation, preventing empty search results
* Fix: Detect and automatically clean up stuck Action Scheduler sync jobs
* Add content splitting as a per-index setting (enable/disable and max record size)
* Add sync error logging visible to admins via AJAX endpoints
* Improve documents column to clarify indexed vs local counts when content splitting is active

= 1.2.4 =

* Fix: URL based search query does not persist in search page
* Fix: CelerSearch menu registers for non-admin users too in wp-admin

= 1.2.3 =

* Respect initial_display setting when search input is cleared in Views

= 1.2.2 =

* Add sorting option in Views and Search areas

= 1.2.1 =

* Fix post splitting / deduplication

= 1.2.0 =

* Add on-demand service health checks from Services page
* Add index document count stats on Indices page
* Fix deleting an index now also removes it from the remote search engine
* Improve service creation form and status display

= 1.1.3 =

* Minor bug fix related to product indexing

= 1.1.2 =

* Improve bundling process
* Add option "Replace Search Results Page" with selected page that embeds View via Block or shortcode in Search area settings for "WordPress Public Search" type
* Add filter celersearch_view_search_hit for adding additional data to the hits response
* Improve UI in view form

= 1.1.1 =

* Improve build process
* Fix admin page icon

= 1.1.0 =

* Add WooCommerce integration
* Add Views
* Improved code quality
* Improved UI/UX


= 1.0.4 =
* Add celersearch as committer
* Add Confirmation for reindex operation
* Fix WooCoomerce order index thumbnail
* Fix Autocomplete dialog result display HTML escaped strings

= 1.0.3 =
* Add WooCommerce Orders index
* Improved code quality

= 1.0.2 =
* Improved code quality

= 1.0.1 =
* Fixed minor bugs

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.0.0 =
Initial release of CelerSearch.
