WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] Shortcode contents not found (7 posts)

  1. wpfan1000
    Member
    Posted 10 months ago #

    Hi,

    I wrote a shortcode that will take the contents of one page (lets call it the source page) and put it in another page (lets call it the destination page).

    Therefore both pages have the contents of the source page in them.

    When I search for a phrase eg "2007-2008" which I know is in the source page, then the plugin will show the source page in the search results but not the destination page.

    My understanding of this plugin is that it will included the contents of the shortcode.

    I do enable "Expand shortcodes" in Relevanssi settings.

    I am using the WP standard search box that comes with the Search widget.

    I enabled logs and the plugin is logging the search.

    Please help, thanks ahead of time.

    http://wordpress.org/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 10 months ago #

    If you reindex the database, does it work then? Note that when the source page contents change, the destination page contents don't change in the Relevanssi index.

  3. wpfan1000
    Member
    Posted 10 months ago #

    Hi,

    Thanks for your quick response.

    I did reindex the database, twice.

    All the content was there before I installed the plugin, then after I installed the plugin, I built the index, then again.

    When you say:

    "Note that when the source page contents change, the destination page contents don't change in the Relevanssi index."

    Is that completely accurate?

    Or is it more accurate to say that the destination page does not change until after the next index is done?

    Thanks!

  4. Mikko Saari
    Member
    Plugin Author

    Posted 10 months ago #

    Yes, that's what I meant - the destination page is not automatically refreshed, but the index is refreshed whenever the destination page gets reindexed.

    Does your shortcode follow WP standards? Does it return the content, or echo it?

    Can you check the database directly with phpMyAdmin or similar tool? Do the words in the source page appear in the database for the destination page?

  5. wpfan1000
    Member
    Posted 10 months ago #

    Hi,

    My shortcodes do return not echo or print.

    I did check the database and I find the shortcode in the contents of a page.

    Now please correct me if I am wrong, but to me this would make sense since this is the content displayed in the editor, not the front end of the site.

    Ie WP only processes the content of the shortcode when it outputs the page to a browser/client.

  6. Mikko Saari
    Member
    Plugin Author

    Posted 10 months ago #

    Yes, the wp_posts table should have the shortcode, but I meant the wp_relevanssi table - search that for the destination post ('doc' is the same as 'ID' in wp_posts table), do the contents of the source page appear there?

    Also, make sure Relevanssi settings page has "extend shortcodes" enabled.

  7. wpfan1000
    Member
    Posted 10 months ago #

    Hi,

    I checked the table and I do see that the words in the source page are also in the destination page.

    I dont know what changed but the search seems to be working now.

    Thanks for your help.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags