Hi @inkedraskal
Thank you very much, I am going to examine this theme code and return back with my idea or even Hook code.
Thanks!
Hi @inkedraskal
Thank you very much, I am going to examine this theme code and return back with my idea or even Hook code.
Thanks!
Hi @inkedraskal
I would be happy to help you with this. As I can see, the theme you created with the given link can be very different. Usually to test and develop a Compatibility Hook I will need to have a theme code closer to that you are using.
So, could you explain how I can create the same (or close) theme that you have to make tests? Or even better if you can send your version of the theme.
Also to test indexing and search without theme clashing I would recommend to use Sandbox Area / Test Search. This tool will return the non-filtered result that is not touched by the theme code.
Please let me know if you can provide more data to me,
Thanks!
Hi @inkedraskal
Yes, both to highlight results and correct search/indexing.
Let me know if it's not good with your theme.
Hi @inkedraskal
Thank you for the question. Do you really need to install this hook? It is required only for themes that are incompatible with WPFTS without it.
Do you think your theme is not compatible?
"Unavailable" status means we don't know if this hook is required.
I hope this helps.
Hi @alihs
I think I know what happens.
There is a "hidden" property of $chunks that we remove when returning array()
.
This property contains the list of rules applied to the post, and this fact actually forces WPFTS indexer to mark posts as "non-correct" indexed.
We have "__used_rules" property in $chunks which we have to store.
Please change your hook code like this
if ( $date_listing <= $date_now ) {
// i was returning false here, which i now realize was wrong.
return array(
'__used_rules' => $chunks['__used_rules'],
);
}
I think that should help.
Please try and let me know what happens.
Thank you!
Hi @alihs
Thank you for your reply!
According to the video you sent it looks like you have around 257 that is constantly refreshing. Those posts are simple and short, and reindeer can refresh them in one internal "tick", but it looks like they are changed very often.
Strange thing, actually!
Could you check the Indexing Rules page where it may show which rule has those 257 unsynced posts?
Also, could you say which 257 posts you have? May be specific post type has exactly 257 records or something.
Thank you!
Hi @alihs
I hope the code you showed is an excerpt and you still have
$date_now = current_time('timestamp');
somewhere and also your $date_listing value is a Unix timestamp (integer).
For the second case: this AJAX action is used by the WP admin to refresh some index statistics, it does not have any parameters (that's why "z" is empty here).
The message you see means that 257 posts were processed by an outdated version of one or more indexing rules and WPFTS wants to reindex them to bring everything into compliance.
You can open the page with the list of rules and see which indexing rules are not compliant.
You can also send me a screenshot so I can help you figure this out.
By the way, this may be due to the fact that you somehow change some posts from the code, but do not call the "save_post" hook, which triggers reindexing under the hood. Because of this WPFTS considers these posts outdated. If the number of posts controlled by the rule is not 257, then this is exactly the case.
Let me know if you have more information.
Thanks!
Hi @alihs
Sure, you can do that using the wpfts_index_post hook.
You can implement custom logic inside the hook code and then return normal $chunks
value in case you want the Event post to be in the index or return $chunks = array();
(empty array) in case you want to remove the post from the index.
There is no way (by plugin logic) to remove a post from the index completely, but the method above will store an empty record for your expired event, so it will be 100% not searchable and will not take DB space.
Note, another (and more convenient) way to remove posts from the search index is to change their post_status
to "draft", for example, and be sure the "draft" status is listed in the excluded list.
It says WPFTS to save only ID information about the post. But without hooks or complex logic.
Let me know if this helps.
Thank you.
Hi @stark
Unfortunately, WPFTS does not work with PODS custom fields "from the box", so custom code exists somewhere. I think your developer used another way to add data to the search index.
We need to ask him or alternatively, I could check your code myself, it should not be too long. In this case please send me admin access to your resource using a private message.
Thanks.
Hi @stark
Yes, as soon as you can show me your custom code for wpfts_index_post hook I think we can detect a problem and fix it.
Thanks!
Hi @stark
Could you test posts 22515 and 11804 on the first tab of the Sandbox? I am curious which data were indexed in those posts, may be the SAME data was indexed for all those posts. The same relevance ratio (80%) is very less probably for such amount of posts.
Also I would see the code you are used to put meta fields to the index. Could you share?
Thanks!
Hi @stark
Thank you for the question!
I think you know how to deal with PODS custom meta fields because I see that you have created clusters with data in the index, and I think it was achieved by the custom code. That's 80% of the job!
As I can see your post records are searchable in the Sandbox by words from the "0" cluster (the custom metafield).
The only problem is you can not get your custom posts shown in the search results on the front page.
This may be caused by a hook in your theme or custom code that intercepts pre_get_posts or another hook related to WP_Query and adds additional filtering to posts either at the input parameter level (for example, it allows searching only posts with post_type = post, page; or adds additional WHERE conditions directly to the query that is formed in WP_Query). I would advise you to review the code of your custom plugins and theme for such hooks. I also recommended that you disable all plugins that may be related to search for testing. For example, Elastic Press.
We are not very familiar with the functionality of PODS, it is obviously similar to the ACF plugin in the database, but it probably also adds some conditions to the search.
The presence of a conflicting hook may also be indicated by the fact that in analytics all queries show either 0 or -1 results, which is incorrect information.
By the way, could you click on any of the rows in the analytics table and see the query details? That might give us a clue as to why this is happening.
Also, give me some time - I need to see if The7 theme conflicts with WPFTS.
Thanks! Let me know if any of the above tips helped you.
Actually WPFTS could be not that great for you in case you have millions of records (e.g. posts).
The whole Wordpress could be not good for you either, because to handle such amount of data you will need to use specific optimization and caching algorithms and even clustering.
I would like to propose you to use full-text solutions based on Apache Solr or Elastic Search - those tools are implemented in Java and work way faster than PHP+MySQL solution provided by WPFTS and they are especially good for big data.
Alternatively you can wait until we release a new WPFTS version (in 1-2 months) that can use self-hosted Elastic Search engine to keep full-text index and uses WPFTS data collecting algorithms.
Thank you for the question.
Hi @jgregory_ca
Okay, the fix for Avada addon should be ready in a couple of days. Just FYI.
Thanks!
Hi @magicalbrad
Many thanks for your report and for sure for your work to fix this issue. We don't face the same on our dev machine that probably caused by version difference or so.
Anyway, I will analyze this problem with deep care and for sure release a new addon version soon.
Thanks!!!
@jgregory_ca
Okay, actually the addon is for different thing. I was just interested if it made this problem or not.
Now I know the reason is not in addon.
Let me make some tests on my dev machine to repeat the bug and find the solution.
Hi, @jgregory_ca
Do you have any WPFTS Addons installed? For example WPFTS Addon for Avada Theme.
Thanks!
@ibloom
Thank you, this is actually the thing which I would like to recommend you to do.
Você pode me dizer qual tema seu site está usando atualmente? Pode haver uma incompatibilidade de tema/WPFTS (e isso é fácil de corrigir).
Além disso, para indexar arquivos do WPDM você precisa instalar um complemento simples
https://wordpress.org/plugins/wpfts-add-on-for-wp-download-manager/ (não se preocupe se não for atualizado há algum tempo - iremos atualizá-lo em breve).
Isso permitirá que o WPFTS veja os arquivos adicionados ao WPDM.
Peço também que você compartilhe um link para o seu site - isso agilizará a busca por uma solução.
Obrigado!