Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

TNT Search results - how to keep them narrow

plugins

Solved by Daniel Wrightson View solution

Started by Daniel Wrightson 6 years ago · 9 replies · 982 views
6 years ago

I've added TNTSearch to the site I'm developing at the moment but I'm getting a strange request from the client - and I'm not sure I agree/understand but here goes:

At the moment if I search for "Chanel" (it's vintage designer stuff) I'll get everything with "Chanel" in the title, content or page header. If I search for "Chanel Bag" and I only have 3 bags, I'll get those three bags in the first three positions, then I'll get items that are Chanel, but not bags, and then bags that are not Chanel.

This makes sense to me - but the client would like the results to include ONLY "Chanel Bags" - nothing else. Is this possible?

6 years ago

@dan-james, If I understand correctly, they see everything matching 'Chanel Bag' + everything matching 'Chanel' + everything matching 'Bag'? Right?

Isn't that what everybody expects to get when using Google?

Google provides exact match using quotes. I've tried enclosing the search term in quotes on a demo site of TNTSearch itself, but it seems it doesn't give an exact match as Google does.

6 years ago

@dan-james, What happens when you set the fuzzy option to false>

From the TNTSearch plugin:

fuzzy - matches if the words are 'close' but not necessarily exact matches

6 years ago

I’ve now tried with fuzzy set to false,
phrase matches on or off and it always returns

"everything matching ‘Chanel Bag’ + everything matching ‘Chanel’ + everything matching ‘Bag’?” as you said.

It’s also the behaviour I would expect - not sure what to do on this one.

Best,

Dan

6 years ago

@dan-james, If the platform being used cannot provide the requirements of the client (or you just don't know how), just say so...

There is no single platform that meets all requirement of the client without making compromises on price, functionality or project duration. And some compromises may be a disappointment...

Your solution might not provide their idealized search engine, but does meet other requirements.

Search engine alternatives:
If search is a hard requirement, something else has to give, like price. There are search engines specifically targeting ecommerce sites. Doofinder.com is one of them and also targets the shortcomings of Shopify's search engine. It provides a PHP Search API and Management API you should be able to integrate in the site.

The compromise? It comes with a price and extra labour on your part...

6 years ago

Thanks for these suggestions. I originally proposed using GRAV + Snipcart as I like the speed of flat-file, I like de-coupling the e-commerce section from the front-end and it's very easy to move servers, pause the whole enterprise, slim down or ramp up when needed.

I now think they may well be more comfortable with Shopify - I've told them I'll help them set up a theme if they choose it. Some jobs just don't go the way you thought..

6 years ago Solution

Hi @pamtbaau, thought you'd like to know it's boolean. I set that as the default and know the search works as expected.

"Chanel Black Bags" now only returns "Chanel Black Bags".

6 years ago

@dan-james, What part of true and false in the docs didn't you understand...? ;-)

fuzzy: false
phrases: true

Btw. Still going for Shopify?

6 years ago

I feel a bit foolish. But, to be fair, I had fuzzy set to false and phrases set to true. It was this fellow that made the difference:

Screen Shot 2020-08-09 at 14.35.28|553x158

I think we'll avoid shopify - I'd certainly prefer to...

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 43 1 week ago
Plugins · by Xavier, 4 weeks ago
2 54 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1181 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 48 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 73 2 months ago