• Hi,

    I’m using Relevanssi Premium with qTranslate-X (English and French) and I’ve noticed that titles aren’t been indexed if the post content doesn’t exist in that language, even if the word is present in the title.

    E.g. I have post which have “Chimie” in the french title, but there is no post content in french, only in english. So when I search for “Chimie” results doesn’t find this post.

    Any ideas?
    Thank you in advance.
    Marcio

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

    (@msaari)

    Is the problem in indexing or in searching? I’d check that first. Does the word “chimie” appear in the wp_relevanssi database for the correct post?

    In any case, I don’t know how qTranslate-X works in the first place, so I’m not sure how compatible it is with Relevanssi. Does it create multiple copies of the post?

    Thread Starter Marcio Marim

    (@marciomarim)

    Hi Mikko,

    I’ve checked and the term chimie doesn’t appear in wp_relevanssi for the post.

    qTranslateX keeps all languages in the same post. For example, in wp_posts the post title for this post in English/French is:
    [:en]Chemistry of Biomolecules[:fr]Chimie des biomolécules[:]

    So when I search in wp_relevanssi for the right post ID with title = 1, the only words indexed are Chemistry and Biomolecules.

    Do you have any idea why? The tags [:en] and [:fr] doesn’t seem to be a problem because the words in english are correctly indexed.

    Plugin Author Mikko Saari

    (@msaari)

    In that case I think the problem is that qTranslateX filters the title somehow before Relevanssi sees it, and Relevanssi only sees the English title. How to fix that, I don’t know.

    Thread Starter Marcio Marim

    (@marciomarim)

    Yes, qTranslateX filters the title so in Relevanssi, indexing.php line 319:

    $titles = relevanssi_tokenize(apply_filters('the_title', $filtered_title, $post->ID), apply_filters('relevanssi_remove_stopwords_in_titles', true));

    When using apply_filters(the_title) only the default language is being indexed.

    Is it possible to not use apply_filters(the_title) because all terms are present in $post->post_title ?

    Thanks,

    Plugin Author Mikko Saari

    (@msaari)

    That filter must be applied there, because other plugins depend on it.

    However, Relevanssi first runs the title through the relevanssi_post_title_before_tokenize filter. You could add a filter function there that strips out the qTranslateX codes, so when the title then goes through the_title, they’re not there anymore.

    Thread Starter Marcio Marim

    (@marciomarim)

    Ok I did what you suggested.

    Is there any way to re-index specific posts to see if it is working?

    Plugin Author Mikko Saari

    (@msaari)

    Just save the post.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Search not indexing correct languages in QtranslateX’ is closed to new replies.