• Resolved Andrea

    (@ancan)


    I read about other posts, that the only way to avoid blocking the plugin indexing is to disable the option “short code expansion”.
    I have tables made with “TablePress” that I would like to index. They have some shortcodes in some pages.
    If I disable the expanding shortcode field, they are not indexed and I do not get those tables in the search results, but I need to have them.
    In the “Indexing Options” the type “tablepress_table” is set activated in the “Index” column, but the “Excluded from the search?” Column it is set to “yes”. I have read that that column does not matter in building the Relevanssi index, but how is it possible to change that column from “yes” to “no”?
    How can I index my tables without getting a indexing freeze of Relevanssi?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Mikko Saari

    (@msaari)

    TablePress tables shouldn’t freeze Relevanssi indexing. Relevanssi has built-in support for TablePress.

    Have you tried running the installing with shortcode expansion enabled? It’s an option you can use. It’s not inherently broken, just that some shortcodes have problems with it. TablePress isn’t one of those.

    You generally don’t want to index the tablepress_table post type, because usually you don’t want to see the tables in the results, you want to see the posts the tables are embedded in. So just enable shortcode expansion and try building the index, that should get you TablePress content in the index.

    You can’t change the “Excluded from search” column to “no”, but as you know, it doesn’t matter in the indexing.

    Thread Starter Andrea

    (@ancan)

    Yes, I have tried several times to perform indexing with the option “shortcode expansion” enabled, but after counting the articles we see the counter of the elapsed time that continues to increase, but the horizontal top bar remains empty.
    On the other hand, if I disable the “shortcode expansion” option and start creating the index, I see the green top bar incrementing and after just 36 seconds the indexing of the site ends (there are only 76 articles).
    The problem may be related to some other “shortcode”, rather than to tablePress.
    I use shortcode from:
    – TablePress.
    – SDM (Simple Download Monitor).
    – MetaSlider.
    – Responsive Posts Carousel.

    Regards,
    Andrea.

    Plugin Author Mikko Saari

    (@msaari)

    Yeah, TablePress is not the problem. Carousel or Slider probably is. Try these, please: add these to your theme functions.php and then rebuild the index. Use just one at the time, and see if that helps.

    add_filter( 'pre_option_relevanssi_disable_shortcodes', 'rlv_test_metaslider' );
    function rlv_test_metaslider( $option ) {
        $option = 'metaslider';
        return $option;
    }
    add_filter( 'pre_option_relevanssi_disable_shortcodes', 'rlv_test_rpc' );
    function rlv_test_rpc( $option ) {
        $option = 'wcp-carousel';
        return $option;
    }
    add_filter( 'pre_option_relevanssi_disable_shortcodes', 'rlv_test_sdm' );
    function rlv_test_sdm( $option ) {
        $option = 'sdm_download';
        return $option;
    }
    Thread Starter Andrea

    (@ancan)

    I added one function at a time to the “functions.php”, I enabled “Expansion shortcode”, I started creating the index.
    These are the results:
    1° Function (‘metaslider’): nothing, indexing freeze.
    2° Function (‘wcp-carousel’): nothing, indexing freeze.
    3° Function (‘sdm_download’): nothing, indexing freeze.
    So no function solves the problem.

    Thanks
    Andrea.

    EDIT: I have noticed that the indexing always hangs at the same point: when I reload the page (after seeing that it does not update), the writing appears that has indexed only 6 documents (instead of 76). Now I ask myself: can I then understand what is the page that causes the freezing? In which order does the indexing take place? Before the pages or before the articles? Are they scanned by order of ID or by alphabetical order?

    • This reply was modified 8 years ago by Andrea. Reason: News
    Plugin Author Mikko Saari

    (@msaari)

    The posts are indexed in descending order of ID so yes, you can look at the wp_relevanssi database table to see the lowest ID indexed and go from there (that’s why Relevanssi shows the highest post ID indexed, unfortunately it doesn’t help anymore now that Relevanssi has switched the direction of indexing; I’ll change that to the lowest ID in the next version so it’s useful again).

    Try this to disable all three shortcodes:

    add_filter( 'pre_option_relevanssi_disable_shortcodes', 'rlv_test_metaslider' );
    function rlv_test_metaslider( $option ) {
        $option = 'metaslider,wcp-carousel,sdm-download';
        return $option;
    }

    If this works, you can then try removing one shortcode at the time to see if some of them work.

    Thread Starter Andrea

    (@ancan)

    Not even this new filter has solved.

    But by accessing the DB Relevanssi and comparing the indices that could analyze with activated shortcode with the indexes that could analyze with shorcode disabled, I was able to understand what is the ID of the post that creates problems: EUREKA!
    In summary: the cause of all this is due to the shortcode of the SDM Simple Download Monitor plugin.
    There is a shortcode that allows you to list only the downloads that correspond to a certain category (or query) and shows the results (example: [sdm_latest_downloads number=”1″ category_slug=”MyCategory” fancy=”1″ button_text=”Download!” new_window=”1″]).
    In the case of this page (the ID that creates the first problem) this shortcode does not return a result because there is no download that is present in that category (with that language managed by PolyLang). Therefore on the web page you will see the writing: “There are no download items matching this shortcode criteria.“.
    For proof I deleted the shortcode on that page, I redid the Relevanssi index and it went further than usual: it indexed 10 documents instead of 6. This means that the defect was in that short code.
    Now the problem is: how can you solve it?
    If I disable Relevanssi and use standard wordpress search, everything works regularly, but I would like to use Relevanssi !! 😉
    I can not even delete those shortcodes, because they have to list the downloads as they are added to the various categories.
    Maybe now you will have clearer ideas on how to deal with this problem?

    Thanks
    Andrea

    Plugin Author Mikko Saari

    (@msaari)

    Ok, if that’s the problem shortcode, this should solve the problem then:

    add_filter( 'pre_option_relevanssi_disable_shortcodes', 'rlv_disable_sdm' );
    function rlv_disable_sdm( $option ) {
        $option = 'sdm_latest_downloads';
        return $option;
    }

    If that works, I can add sdm_latest_downloads to Relevanssi’s list of shortcodes that are automatically removed when indexing posts.

    (I tried reproducing this issue, but have no issues with the plugin, the shortcode indexes just fine.)

    Thread Starter Andrea

    (@ancan)

    Finally this way it works. Good!
    Now you have to insert this exclusion directly in Relevanssi otherwise at the next update of my theme, this modification to the functions.php file will be lost.
    Remember to make the change to view the LOWEST index analyzed during indexing: this would have been very useful for finding this problem.

    Regards,
    Andrea.

    Plugin Author Mikko Saari

    (@msaari)

    Next version of Relevanssi will block sdm_latest_downloads shortcode in indexing, and will indeed show the lowest post ID.

    If your theme has updates, it’s often a good idea to create a small custom plugin where you can put functions.php modifications so that they are safe from theme updates.

    Thread Starter Andrea

    (@ancan)

    I prefer to leave the standard themes, if it is not essential.
    If you make this change you wrote (Block sdm_latest_download), even if the functions.php is overwritten by a theme update, will the indexing continue to run regularly or will I have the above problems again?

    Andrea.

    Plugin Author Mikko Saari

    (@msaari)

    This should now be fixed in version 4.0.8.

    Thread Starter Andrea

    (@ancan)

    Ok. So since I have 4.0.8 I can feel comfortable that if there is an update of my theme there will not be this problem anymore.

    Thanks,
    Andrea.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Indexing with “short code expansion” enabled’ is closed to new replies.