Post type filters, orders and indexing
In the Filtering tab of the post type editor you can setup filters, search orders and configure indexing.
Create and manage all the filters for this post type. These filters can then be used to create search forms in front-end. There are various filter types which can use as a source different types of fields
Allows you to create a keyword text search filter. You can pick various fields you want to include in the search pool including Title, description, location and other custom fields.
An index of all the data included in the search pool is then created. This powers fast query performance even in extreme scenarios (high volume of posts).
Note: When making changes to the search pool, you have to Recreate the index manually under Indexing status tab.
This filter uses coordinate data from Location fields to find posts by their geographic location. It matches posts based on the bounding box for a given location.
Recurring date filter
This filter works with all Recurring Date fields. It can match posts both based on the start and end dates, and any future recurrences configured by the post author. It can be configured to search for single dates, date ranges, ongoing dates, etc.
Similar to the Recurring date filter, except this filter uses Date fields as the data source, which are simpler with a single date picker (and optional time picker).
This filter work with Product fields. It will match posts based on the Product field’s booking/availability calendar, and it also accounts for fully booked days.
It can be used to search for either specific dates or date ranges, and when searching a date range, you can set whether to match posts having at least one available day in given range (lazy matching), or have every day in range available (greedy matching).
This filter can also be used to match recurring booking dates, if the product field is configured to use dates from a recurring date field for its booking/availability calendar.
Open Now filter
The Open Now filter works with data from Work Hours fields. It can match open posts based on the individual timezone of each post.
This filter works with all Number fields. It displays a single number input, with increment and decrement buttons. You can configure the minimum and maximum values, step size when incrementing/decrementing, and the comparison logic to use (equals, less than, greater than).
If you’re using a Product field in your post type, and that product has a numeric addition, e.g. “Number of rooms”, all these additions can be used with this filter as well.
Similar to the Stepper filter, this filter works with Number fields, and is shown as a range slider, with either a single handle or double handles. It can look for matches either inside the selected range, or outside of it.
This filter works with all Taxonomy fields. It lets the user pick one or more terms from the selected taxonomy. Terms are shown in either their default order, or optionally in alphabetical order.
If the terms are hierarchical, they will be shown in a hierarchical layout.
You can modify the term default order, even after terms are created in the backend. To do this, navigate to the taxonomy screen (e.g. WP Admin > Posts > Categories), and click the “Reorder Terms” button.
This filter works with all Switcher fields, which are used for storing simple Yes/No values. The filter displays a single switch, and when checked, it can be configured to match all posts with the Switcher field set to either Yes or No.
If you’re using a Product field in your post type, and that product has a checkbox addition, e.g. “Include Parking?”, all these additions can be used with this filter as well.
This filter can be used to match posts from a single author.
Order By filter
This is a special filter that displays ordering options that are configured for this post type. Ordering options are configured in the post type editor, in Filtering > Search order.
Aside from filtering, we also want to set the order in which filtered posts appear on. This can be fully configured in the post type editor, in Filtering > Search order.
There are multiple preset ordering options, pre-configured and ready to use:
Other than presets, you can also add Custom ordering options. Custom ordering options allow for ordering based on a specific Date field, Number field, Text field, etc.
It’s possible to have multiple clauses for a single ordering option, e.g. you may want to order by post priority first, and if multiple posts are on the same priority level, you can add a secondary clause to then order them by another property, e.g. date created.
In Voxel, all data used for filtering is stored in a separate, “index” table. We have full control over how we store data that we know are only going to be used for filtering. This allows us to store them in the most efficient and optimized format for this purpose alone: search performance.
The index table is created automatically based on the search filters configured on the post type, and individual posts are automatically re-indexed any time they’re edited, created, deleted.
This is the third subtab in the Filtering tab in the post type editor. It gives you a quick overview of the current indexing status for posts of this post type, like number of published posts, number of indexed posts, and the ability to manually re-index all posts.