Skip Navigation

[Closed] Some lyrics in Hebrew have apostrophes. When searched on no results show.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 6 replies, has 2 voices.

Last updated by Nigel 1 year, 7 months ago.

Assisted by: Nigel.

Author
Posts
#2676965

Tell us what you are trying to do?
Have search views built. But

Is there any documentation that you are following?

Is there a similar example that we can see?
Search on "Botu’ach Ani" yields no results. Search on "ach Ani", the song "Botu’ach Ani" shows in the results. How do we work around the apostrophe (or single quote) in a search term?

What is the link to your site?
hidden link

#2677018

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi there

I couldn't really get the search to work at all, irrespective of apostrophes.

I can see there is a song titled "A Friend Comes to Visit", for example.

If I search the song titles for "friend" then this song is not returned in the results, and the handful of results that do appear seem to do so because the Album title includes the word "friends".

So the fields and what they are searching seem to be mixed up.

Perhaps we could take a look at the back end of the site to be able to see how this is set up and try and understand where it is going wrong.

Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.

#2677113

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 3.png
Screenshot 2.png
Screenshot 1.png

I'm not sure we are talking about the same thing, because searching for "ain't" doesn't produce any results (screenshot 1).

Checking the View settings for the search field (screenshot 2) I can see why: the comparison is "equal to", and there are no songs with a title of just "ain't".

I assume what you need is a more flexible match, which you can achieve by changing the comparison to "Like", which I have done.

Following that, when I search "sho'alti" it delivers the expected results (screenshot 3).

#2677176

The Search All form is set to "Like". When I search on "Achas Sho’alti", get no results. Search on "Achas Sho" get the 3 songs "Achas Sho’alti", "Achas Sho’alti 1", and "Achas Sho’alti 2".

Have switched Song Title search to "like" as well. Same results.

#2677232

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2024-01-05 at 08.16.31.png

I don't know where the "Search all" form is, but on the search page you linked to searching "Achas Sho'alti" delivers the expected results (screenshot).

Perhaps you could share some screenshots so I can understand what it is you are doing differently.

#2677774

Have pinpointed it down to the apostrophe. On Search All, if I perform search on "Achas Sho’alti" results in 0 songs returned. If I replace the apostrophe with the generic apostrophe ("Achas Sho'alti"), the 3 songs are returned. How can I apply a filter to swap/replace characters like that?

#2677807

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

It isn't possible to do some kind of fuzzy matching which doesn't care what kind of apostrophe is used: the search term and the data being searched need to correspond.

If the data has been saved with straight apostrophes then the search term must use straight apostrophes.

Probably the simplest solution would be to add a little JavaScript to your form to automatically replace typographic apostrophes with straight apostrophes.

Something like this:

document.getElementById('theInputID').addEventListener('input', function(event) {
    event.target.value = event.target.value.replace(/'/g, "'");
});

You need the ID of the form input to target (or you could use document.querySelector and target the input field class to apply this to multiple search inputs).

The topic ‘[Closed] Some lyrics in Hebrew have apostrophes. When searched on no results show.’ is closed to new replies.