• Resolved whereverpanda

    (@whereverpanda)


    Hi there!

    I noticed today that on my site search, Relevanssi is not just indexing my pages (which is all that is checked) but some news items as well (CPT called news).

    It’s unchecked, the post type is set to be excluded from the site search and the option is ticked in Relevanssi to respect that.

    The only thing that seems to get these news items out of the search is to add their post ID’s to ‘Post exclusion’.

    Can you help in identifying the issue?

    Could this be an issue with the newest update?

    Thanks!

    • This topic was modified 3 years, 10 months ago by whereverpanda.
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Mikko Saari

    (@msaari)

    That should not be possible… If you look at one of the news posts with the Relevanssi debugger (Settings > Debugging), what does that show for the post? Does it appear indexed there? If you then rebuild the index, does it still remain indexed? Do the posts appear in the Relevanssi admin search (Dashboard > Admin search)?

    There are two possible scenarios here:

    1. The posts are being indexed for some reason, even though Relevanssi is set to not index them. The likely reason then is something that appears in your posts and corrupts the global $post variable so that Relevanssi ends up indexing the wrong post.

    2. The posts aren’t actually indexed, but still appear in the search for some reason. This would be some third-party interference, filter hooks or something like that that is changing the search results somehow.

    Thread Starter whereverpanda

    (@whereverpanda)

    Hi Mikko,

    In the debugger, it does appear indexed.
    In the Admin search, when the ‘Post Type’ is set to any, these posts do show up.
    This is before and after rebuilding the index.

    1. Can you possibly explain something like this? Because these all the news items (and it seems another type is doing it as well that only has a title, link field and Featured image) have been on the site for a long time and is suddenly doing this.

    2. Again, nothing changed on the site, aside from routine plugin updates.

    In my Custom fields, I still have ‘some’ selected, with ‘ct_builder_shortcodes’ in the text field there.

    Is there a way to see all posts that are indexed so I can manually remove the wrong ones from the results?

    On the ‘Index’ page it still says as its always said:

    35 documents in the index.
    4316 terms in the index.
    3 is the lowest post ID indexed.

    Which is about the right amount of pages.

    • This reply was modified 3 years, 10 months ago by whereverpanda.
    Plugin Author Mikko Saari

    (@msaari)

    The case of 1 is something like where you have a post loop in a shortcode and that changes the global $post object, but it would also lead to the original page not being indexed, and in any case this is a hole that should already be patched up.

    Since you’re using Oxygen, that may have something to do with this. Oxygen is utterly unusual, so it doesn’t surprise me a site using Oxygen does something weird. In the latest version, the one thing that changed for Oxygen is that now Relevanssi indexes the contents of the PHP and HTML code blocks in Oxygen. Are you using PHP or HTML code blocks?

    So even if you reindex and update the post counts, you get the correct number of documents in the index, yet the news posts are still being indexed? That really doesn’t add up.

    The only way to see the whole index is to look directly at the wp_relevanssi database table.

    Thread Starter whereverpanda

    (@whereverpanda)

    Hi Mikko,

    There are PHP and HTML code blocks, but they are only on pages (which are indexed). The random news and other posts that are showing up just uses the standard WordPress interface.

    Could it possibly help deactivating the Relevanssi plugin, removing the tables with WP Optimize and reactivating the plugin and re-setting it up?

    I only noticed it this morning (Friday) and I think this only started when Relavanssi updated earlier this week. The plugins update manually and I check the search every Friday (so last Friday it was still working fine as far as I can tell)

    Plugin Author Mikko Saari

    (@msaari)

    Reindexing empties out the Relevanssi database table, so I’m not sure how much deleting the tables would help.

    You could try rolling back to 4.12.5 (old versions can be found here) and reindexing with that. Does that remove the problem? That would rule out whether this is caused by the Relevanssi update or not.

    Did you rebuild the index after the plugin was updated this week? Or did the posts appear in the search results without indexing?

    Thread Starter whereverpanda

    (@whereverpanda)

    Hi Mikko,

    Can I just upload this via the WordPress Plugins > ‘Add New’ > ‘Upload Plugin’ interface and it will replace the new one with the old one? Sorry, as I mentioned, I’m not very savvy with this stuff so I’ve never rolled back a plugin before.

    I did rebuild the index since the plugin was updated (and multiple times today).

    • This reply was modified 3 years, 10 months ago by whereverpanda.
    Plugin Author Mikko Saari

    (@msaari)

    No, just rewriting won’t do. It’s easiest if you can just replace the files (with FTP, for example), otherwise you need to deactivate, uninstall and then install, and that remove all your settings and index.

    Thread Starter whereverpanda

    (@whereverpanda)

    Hi Mikko,

    THANK YOU! This seems to have solved it. In the front end at least, which is the most important. This is after rolling back, re-indexing and clearing the site cache.

    When searching for some of the terms in the front end that proved problematic earlier today, I get none of the random news posts or others, only pages, which is how it should be.

    However when using the Relevanssi admin search, setting the ‘Post type’ to ‘Any’ and searching for some terms that brought up those random posts (or just leaving the search field blank and searching), it still shows those posts (as it did in version 4.13).

    But in the front end it works, which is the important part.

    The index results changed from what I posted previously to:

    35 documents in the index.
    4297 terms in the index.
    3 is the lowest post ID indexed.

    Does this then mean that this has something to do with the Relevanssi plugin? And how long can it be kept un-updated on this site?

    Thanks again!

    Plugin Author Mikko Saari

    (@msaari)

    So, essentially, nothing has changed in the index.

    Frankly, I don’t have any clue what’s wrong here. What you are describing is borderline impossible, and with the information available to me, I have no means to tell why the site is acting like that. Could be Relevanssi, though if the admin search is still bringing up those results, it seems unlikely the problem was really introduced in the latest version. I’m guessing Oxygen might have something to do with this.

    Without a closer look at what is actually happening –?now I don’t really know what Relevanssi is doing here, I just know what you describe it looks like on the front end, and that’s quite a few layers away from what Relevanssi is doing – I can’t really say anything concrete about this.

    Thread Starter whereverpanda

    (@whereverpanda)

    I’ve never used the admin search before, so it’s possible that the admin search was already an issue in earlier versions of Relevanssi.

    I can’t imagine why Oxygen would have something to do with this. As mentioned, one of the post types it seems to randomly show, only has a Title, Featured Image and link field. This is then displayed in a grid on a page with a plugin called Query Wrangler. So Oxygen is not involved there (as far as I can see).

    The news items are displayed via a template built in Oxygen, but again, out of 80+ news articles, it randomly seemed to have shown only 3 (which I could pick up).

    And inside Relevanssi’s settings, the only mention of Oxygen is in Custom fields, having ‘some’ selected, with ‘ct_builder_shortcodes’ in the field. And Oxygen wasn’t used to build any of the content in these posts that mysteriously appear, only regular fields and some ACF’s.

    This does seem mysterious to me as well, but the fact that the roll back worked for the front end results, does indicate that something has changed in the newer version that might have caused this…

    Plugin Author Mikko Saari

    (@msaari)

    Well, it can be something else that’s specific to your site, it doesn’t have to be Oxygen. I’m just ready to believe anything from Oxygen ;-D Query Wrangler sounds like something that might also be involved.

    I can’t reproduce this issue on any of my sites; unindexed post types stay unindexed. So as long as I can’t reproduce this issue, I’m not sure I can provide a solution.

    If you have a development site where you can poke around, I do have few ideas that could be checked.

    Thread Starter whereverpanda

    (@whereverpanda)

    I don’t have a development site for this client, but can restore one with All in One WP Migration onto our test domain, but I believe this uses a different type of database, I don’t know if that will be an issue. It will also be on a subdomain, so none of the e-mails and things will work, and I will need to enable the Maintenance plugin so the site is technically offline, and delete their form submissions just as a security precaution, not that I don’t trust you. Will any of this affect what you would need to check?

    I can possibly do this next week. Will you need the current version or the one with 4.13?

    Plugin Author Mikko Saari

    (@msaari)

    As long as the error can be reproduced, nothing else really matters. The version that’s most badly broken is the best here.

    For forum moderation purposes I’ll have to make it crystal clear here that I’m not asking for access myself, I’m just hoping that you’ll set up the site so I can give you things you can check there so we can see what’s up with the site.

    Thread Starter whereverpanda

    (@whereverpanda)

    Hi Mikko,

    I have reloaded the site on a test subdomain (with v 4.13 and all other plugins up to date).
    The site still worked as it did before with the posts showing that shouldn’t be showing in the search results.

    I’m having another issue now though. I tried to rebuild the index, but now, it never stops building the index. It does this once or twice when I rebuild the index on the production site (even before v4.13), but when I refresh, and rebuild again it usually completes. Please see below:

    Wiping out the index... Done.
    Counting posts... 43 posts found.
    Indexed 10 posts (total 10), processed 10 / 43.
    Indexed 5 posts (total 15), processed 15 / 43.
    Indexed 1 post (total 16), processed 16 / 43.
    Indexed 2 posts (total 18), processed 18 / 43.
    Indexed 4 posts (total 22), processed 22 / 43.
    Indexed 9 posts (total 31), processed 31 / 43.
    Indexed 4 posts (total 35), processed 35 / 43.
    Indexed 9 posts (total 44), processed 44 / 43.
    Indexed 4 posts (total 48), processed 48 / 43.
    Indexed 4 posts (total 52), processed 52 / 43.
    Indexed 9 posts (total 61), processed 61 / 43.
    Indexed 4 posts (total 65), processed 65 / 43.

    Could this have something to do with the problem? When I stop it at this point, and look at the index it says:

    4 documents in the index.
    739 terms in the index.
    1082 is the lowest post ID indexed.

    When I look in the database, from what I can gather, it only indexed one page that is a draft, one news item (shouldn’t be indexed) and one item from another CPT that should not be indexed.

    This is now getting seriously worrying…

    What can we do from here?

    • This reply was modified 3 years, 10 months ago by whereverpanda.
    Plugin Author Mikko Saari

    (@msaari)

    Continued this off the forums, and turned out there were some issues with the Relevanssi Oxygen compatibility. Next version will improve that. Hooray!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Relevanssi Indexing unchecked post types’ is closed to new replies.