Exclude two terms in a Search

Hi there,

Trying to find the sytax of excluding two terms in a search.

Any ideas how I can get the below to work?

North -east -west

Just trying return a searh for “North” and exclude “North West” and “North East” in the results.

Cheers,
Chumby

Have you seen this?

Yep thanks Rod. Have tried examples in there.

North “-North East” “-North West” is returning 0 results… where it should return searches for “North” only. Shouldn’t it?

Cheers,
Chumby

I just did a test on my own site and it seems that the kind of double quote makes a difference.
If I used a regular (“) slanted/curly double quote, search doesn’t work as expected and the term I want omitted is not omitted.

But if I use a straight (") double quote, it works as expected.

I’ll report this. Maybe Matt and Ben can add code that will force straight quotes in that field.

OK, thanks Rod,

How do you test the different types of quotes? I only have one kind (curly) on my keyboard. Is there an ascii code or something that I should be using for the straight quotes?

Cheers,
Chumby

Search only supports straight quotes, which should be what your computer provides when entering in quotes from the keyboard.

How are you getting curly quotes into the search field? Please share what browser and OS you’re using and how you’re providing the input (e.g. copy and paste, or exactly what keys/modifiers (shift/ctrl/alt) and key combinations you’re using.

Hi Ben,

May of mislead you there… in response to Rod’s reply I can confirm I am getting the standard quotes (straight) in the search field. Had my terms mixed up - aplogies for that.

Still not sure though why north “-north west” “-north east” isn’t working and returning pics with north and not north east or north west.

Cheers
Chumby

I was searching from my iPad in Safari iOS. the keyboard default keyboard gives me curly quote marks.

Thanks, Rod. Discourse needs a dislike button. Safari isn’t being helpful there.

Hi Chumby, I’ll look into that and reply here.

it may be an iOS thing. I get the same results using Chrome for iOS

Hi ben,

Did you make any progress from this one at all?

Appreciate the help as always.

Cheers,
Chumby

No update. I’m currently working on a bunch of other stuff.

OK Ben. All good. Understand.

Cheers,
Chumby

Hi @Chumby, I’ve looked into this, and the code all looks to be working as it’s meant to.
The reason that searching for north "-north east" "-north west" returns nothing is that all of your photos that match with north also match with either ‘north east’ or ‘north west’. These matches are both in the associated keyword and associated caption.

To see the matches when searching for north, visit this link: https://www.tasmanianphotos.com/backlight/search/?q=north&debug
There’s a lot of debugging information added with that command. If you search for all instances of [north] you’ll see that every instance matches with either north east or north west.

Does that help?

OK, thanks Ben and I will have a closer look.

Didn’t know about that debug link so that could be very helpful indeed!

Cheers
Chumby