Support › Meta Box – FacetWP Integrator › Re-indexing loses data of custom fields in the FacetWP indexResolved
I am new to Meta Box and FacetWP, coming from Toolset.
I'm building my first project with the Meta Box / FacetWP combination (the latest versions) and have an issue with filtering by custom fields.
With custom Taxonomies everything works flawlessly as expected.
But when a facet contains a Meta Box custom field and I press "Re-index" in FacetWP, the data from all custom fields is lost in the FacetWP index, so all field filters on the front end are empty, as if the posts didn't have custom field values. Taxonomy filters stay intact.
The values of custom fields remain in the post itself, but they are gone completely from the FacetWP index table in the database after triggering re-indexation.
When I open one post and simply re-save it, the values of all fields from the particular post "magically" re-appear in the FacetWP index. So, after each re-indexing I would need to open every single post and re-save it, but that is not doable, of course.
I tested it with several field types: checkboxes, text and numbers. The behavior was always the same.
The options "Searchable", "Sortable" and "Filterable" are checked for the fields. Deactivating practically all other plugins didn't help.
It's probably something simple, but after reading the documentation I cannot figure out why re-indexing always loses the data of custom fields.
I will appreciate your help.
Thank you for reaching out.
I'm using FacetWP v220.127.116.11 but do not see any issue after clicking "Re-index", all field values show on the filter as well. Please use the field ID under section Custom Fields instead of section Meta Box in the Data Source input. Screenshot https://share.getcloudapp.com/ApuzKvwY
Thank you for your answer.
Indeed, when I scroll down to the Custom Fields section and use that, the data stays after re-indexing.
However, if I use a Custom Table, the custom fields are not visible in that section, so I cannot select them. I can then only see them in Data Source -> Meta Box -> [CPT Name] Custom Field Label.
According to this thread:
the Integrator supports Custom Tables, so I am a little confused. Of course, I would prefer to use custom tables, when possible. Is it (still) possible to have custom tables with FacetWP?
What is the function of the Meta Box section in Data Source? When would I use that?
Filtering kind of works, but only until I click "re-index"...
Thank you for your feedback.
I also experience that issue with the field value saved in the custom table. It is possible that something goes wrong in the new version of both plugins. I will inform the development team to check this issue and get back to you later.
Thank you, Long.
Hi, wait a solution for that! thanks
We've just tested the plugins with the latest version and the index works well for us. Here are some screenshots:
Custom field settings with custom table: https://monosnap.com/direct/u8XtJOvmYvV6BSj3M20Y6g3BCY2szK
FacetWP settings: https://monosnap.com/direct/qU8rsZkBqHrQRgt3HBu2UXFmmCAiYP
After press Re-index, the data in the database is correct: https://monosnap.com/direct/qr6Zjt3p8dsCDrwb9rrs8xvB2Iz5zy