- Help Center Home
- Getting started
- Introducing FacetWP
- Installation and updates
- FAQ
- How it works
- What are facets?
- Facet types
- Indexing
- Listing templates
- Extras & integrations
- Add-on features and extras
- Using FacetWP with …
- Built-in integrations
- Advanced Custom Fields
- WooCommerce
- SearchWP
- WP-CLI
- Add-on integrations
- Elementor
- Beaver Builder
- WP Recipe Maker and Tasty Recipes
- Relevanssi
- WPML and Polylang
- Pods
- Meta Box
- Flatsome (theme)
- External integrations
- Listify (theme)
- Listable (theme)
- WPGraphQL
- Document Library Pro
- Tips & tricks
- WooCommerce plugins
- WordPress multi-site
- WP Job Manager
- WP All Import
- Easy Digital Downloads
- EDD Reviews
- Intuitive Custom Post Order
- Custom Taxonomy Order
- Post Types Order
- Genesis framework
- WP External Links
- ElasticPress
- Caching & hosting
- WP Rocket
- Cloudflare
- New Relic
- WP Engine
- Fast Velocity Minify
- Incompatibilities
- Incompatible plugins
- Troubleshooting
- Troubleshooting guide
- Using the right query
- Common issues
- Get support
- Developers
- Hooks reference
- JavaScript reference
- Shortcodes reference
- FacetWP REST API
- How FacetWP works
- Tutorials
- Code snippets
- Changelog
ElasticPress
If you are using ElasticPress with a Search facet or with facets on a search archive page, ElasticPress will return error 400 responses with the message “No mapping found for [post__in] in order to sort on”.
The problem happens when a default sort order is used, and no custom orderby
query parameter is specified. In that case, FacetWP by default orders results by relevancy, by setting the orderby
parameter to post__in
.
ElasticPress cannot sort results in a given order passed by an array of arguments (like the IDs in post__in
) but calculates a matching score against a single argument for all the results possible.
The workaround to get FacetWP working with ElasticPress is to customize the query and set the orderby
query parameter to something else than post__in
, or to disable ordering by relevancy with the following code:
add_filter( 'facetwp_use_search_relevancy', '__return_false' );