WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
Encoding issue when add space to an Arabic word (9 posts)

  1. mamouneyya
    Member
    Posted 2 years ago #

    Hi,

    When I put a space after an Arabic word I'm looking for, the returned text doesn't get encoded properly:
    http://grab.by/aX0r
    It's fine when removing the space though:
    http://grab.by/aX0t

    Maybe a simple solution for this, which I have no idea why it's happening, is to trim the search phrase so any extra spaces get automatically removed.

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

  2. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    Relevanssi does already trim the search phrase, so that's not going to help.

  3. mamouneyya
    Member
    Posted 2 years ago #

    Hmm, when I search for a word followed by a space, a plus sign gets added to the URL:
    http://domain.com/?s=word+
    vs
    http://domain.com/?s=word
    Doesn't that mean that the space gets included with the search phrase? Also, the space doesn't get removed after clicking on the search button. Although it refreshes the page returning the results.. the space remains in the search field.

  4. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    Hmm, at least internally the space is removed. You can try removing the space even before the query is passed to Relevanssi.

  5. mamouneyya
    Member
    Posted 2 years ago #

    As I told you in the first post, everything is okay when I search for the same word without a space at the end. It is also fine when I manually remove the plus sign from the URL.

  6. mamouneyya
    Member
    Posted 2 years ago #

    Something strange happens when adding the space, also:
    Without a space: http://grab.by/aXuS
    With a space at the end: http://grab.by/aXuR

  7. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    Well, beats me. Like I said - try writing a function that strips the space before the query is passed to Relevanssi, maybe that helps.

  8. mamouneyya
    Member
    Posted 2 years ago #

    Could you please do that for me? I am still learning, and I don't have the skills yet...

  9. mamouneyya
    Member
    Posted 2 years ago #

    Well. Just figured out it's an issue with the theme I'm using, which is Gantry. I actually found that Relevanssi does nothing, and changing its options/building the index has no effect at all. The theme seems to have an advanced search capabilities that are built inside, with support for marking search words in the results. However, it wasn't made in the WP way at all.. it feels hacky. While I think I won't use it in any later projects, it's too late for such a decision now!

    Well.. was just sharing my thoughts. I know, I'm talking too much :P Anyway, thanks for your time :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags