Support » Plugin: Relevanssi - A Better Search » Indexing – is it automatic ?

  • Resolved ELAN42///

    (@nokao)


    Hi!

    We are using Relevanssi with WP Toolset plugin (to manage custom post types that are Books).

    After a big import (update not insert),
    (we use WP All Import plugin for that purpose),
    all our content is de-indexed, and we have to index it with the Relevanssi index button.

    How can we automatize this task ?
    We need to do this on a nightly-regular-basis.

    Thank you !

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

    (@msaari)

    Indexing is automatic, but using WP All Import does not trigger indexing (which is a good thing, as it’s likely the import would slow down too much if Relevanssi had to index the posts).

    This would be easiest and most secure if you had Premium and access to WP CLI, in which case you could just use cron to run wp relevanssi index every night

    However, if that is not possible, then you need to run relevanssi_build_index( false, false ) to build the index. This is fine and easy, as long as your index is small enough to run at one go.

    Thank you very much.

    Considering we are not only importing but often updating content,
    how do we reset indexing rather than updating it ?

    (I mean… with a function, or command, or url… not as a logged-in human being that clicks a button)

    • This reply was modified 1 year, 11 months ago by ELAN42///.
    Plugin Author Mikko Saari

    (@msaari)

    If you want to just add new content, use relevanssi_build_index( true, false ). If you have lots of posts and the indexing times out before it’s done, you can limit the indexing with a third parameter: relevanssi_build_index( true, false, 50 ) will add 50 posts, and will return an array where the first value is true if Relevanssi has indexed everything.

    thanks !!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Indexing – is it automatic ?’ is closed to new replies.