The Swiftype Blog / We’ve Updated the Swiftype WordPress Search Plugin

We’ve Updated the Swiftype WordPress Search Plugin

WordPress_Plugin_Swiftype

We’ve released another new version of the Swiftype Search WordPress plugin. This release has two new features that will make Swiftype WordPress Search work even better.

First, we’ve added support for WP-CLI. This is great especially for those of you with 10,000+ posts, because indexing from the command line is much faster. You can increase the post batch size to get more posts indexed at once.

wp swiftype sync --index-batch-size=100

You can also quickly re-index by destructively dropping all the documents that have been indexed (great for development).

wp swiftype sync --destructive --index-batch-size=100

If you’ve got WP-CLI installed (and if you don’t, why not?), type wp swiftype in your WordPress directory to see help text for the available commands.

Second, we’ve merged an open source contribution by Paul Morisson to make it easier to modify the query before passing it to Swiftype. The new swiftype_search_query_string filter allows you to pre-process the search query. Add or strip quote marks, remove words from the query, or add them. For example, if you know that your visitors search for phrases more often than combinations of words, you could pre-process all your queries as phrase match to increase the likelihood that your visitors find what they are looking for.

We hope this improves the flexibility and usefulness of our WordPress plugin for all our users. As always, feel free to reach out for help.

Subscribe to our blog