We'll create fresh WordPress site with REST API for Relevanssi installed. You have 20 minutes to test the plugin after that site we'll be deleted.
This plugin provides simple REST API for the popular search WordPress search engine – Relevanssi.
As far as this plugin provides API for the Relevanssi plugin, it should be installed.
Key features
Brief usage examples
Define post type:
Filter by taxonomy/taxonomies:
Exclude category via taxonomies:
For multilingual websites (WPML & Polylang):
https://[your domain]/wp-json/relevanssi/v1/search?keyword=query&lng=en
https://[your domain]/wp-json/relevanssi/v1/search?keyword=test&type=post&orderby=modified&order=DESC
Demo website
You can try the plugin on our demo website http://demo.erlycoder.com/demo1/. For example, you can try the following request:
Basic:
http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test
Order posts by modification time:
http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test&type=post&orderby=modified&order=DESC
http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test&type=post&orderby=modified&order=ASC
Filter posts by taxonomy (one single category):
http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test&tax_query[0][taxonomy]=category&tax_query[0][field]=id&tax_query[0][terms]=3
Filter posts by taxonomy (exclude category):
[http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test&tax_query[0][taxonomy]=category&tax_query[0][field]=id&tax_query[0][terms]=3&tax_query[0][operator]=NOT IN](http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test&tax_query[0][taxonomy]=category&tax_query[0][field]=id&tax_query[0][terms]=3&tax_query[0][operator]=NOT IN)