• Hi. I used relevanssi, and I can customize it with some hooks.

    I would like my own list of stopwords. In ‘Relevanssi Search Options’, I remove all stopwords. It’s working. But when I add a single new stopword, all previous stopwords are coming back.

    I watched the code: in the ‘relevanssi_populate_stopwords’ function, if the list is empty, all default stopwords are added (array_walk( $stopwords, ‘relevanssi_add_single_stopword’ );).

    Could you check that? Thanks you.

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

    (@msaari)

    Yes, it’s currently not possible to remove all stopwords. I’ll have to look into this, but right now the solution is to remove all but one, then add yours, then remove the last original stopword. As you noticed, the list is only repopulated when it’s empty (or just comment out that line and remove everything, then add yours).

    It’s there for a reason, but I’m not sure the reason is good =) I just haven’t come up with a good way to tell whether the stopwords are empty because they haven’t been populated yet or because the user wants them to empty.

    Thread Starter genevieve28

    (@genevieve28)

    Thank your for your answer. But this requires removing stopwords one by one. It’s very long.

    I think if the user is adding a stop word, you can consider that the user has emptied the list.

    It may be interesting to add the possibility to import a list of stopwords to replace the existing one.

    Now these stopwords don’t bother me because I disable them in the search. For example, in French, there is the stopword ‘tes’, and I cannot retrieve results beggining with ‘test’ like ‘test’, ‘testament’…

    Plugin Author Mikko Saari

    (@msaari)

    This will be fixed in the next version, the stopword list does not autofill anymore (it was a temporary measure anyway, necessary to avoid panic when people notice their stopwords missing as they were moved in a different place under the hood).

    For a quicker fix now, you can edit the relevanssi_stopwords option in the wp_options database table directly. It’s just a comma-separated list.

    You can already import stopwords, just not replace the originals – but the “remove all” button will work properly again in the next version.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cannot remove all stopwords’ is closed to new replies.