Skip to content
This repository has been archived by the owner on Jul 23, 2023. It is now read-only.

mvirenius/vafael

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FacetWP ElasticPress Integration

FacetWP ElasticPress Integration plugin adds ElasticPress support for FacetWP search facets. Plugin supports multiple "ElasticPress engines", which could have their own settings like "post_type" and "search_fields". Engine settings are defined by using ElasticPress supported WP_Query arguments, when registering a new search engine.

Requirements

  • Buy, install and configure FacetWP
  • Install and configure ElasticPress and Elasticsearch server

Installation

  • Clone or copy this repo into your plugins directory

Default search engine

Default search engine searches all registered post types using ElasticPress' default search fields:

$defaults = array(
	'post_type'     => 'any',
	'search_fields' => array(
		'post_title',
		'post_content',
		'post_excerpt',
		'taxonomies' => array( 'category', 'post_tag' ),
	)
);

Register new engines

New search engines can be added by using VAFAEL()->register_engine -method in the "init" hook. The first parameter is the name of the engine and the second parameter accepts engine's WP_Query arguments.

add_action('init', function(){
	VAFAEL()->register_engine( 'ElasticPress Page search', array( 'post_type' => 'page' ) );
});

Registered ElasticPress engines are added to the search engine dropdown of the search facet.

Usage

  • Add a new search facet
  • Select "ElasticPress Default" or one of your custom engines as a search engine
  • Insert facet into your site
  • Enjoy a lightning fast search

About

Valu FacetWP ElasticPress Integration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages