advanced search by type ahead

Open to all! Ask other shopowners for help.
Post Reply
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: advanced search by type ahead

Post by zipurman »

Testing URL: https://phoenixaddons.com/demostore/

@burt pretty sure I have ranking logic to sort results based on best match now ... thanks for the idea ;)

@heatherbell @Kofod95 I have added category search and infopage search to the results ... thanks :)

@tessthepup I have added an option to show the extra links at the top or the bottom.

New adjustments:
- re-coded the matching logic, should match better now against all enabled targets
- The NAME and MODEL carry heavier weight, so if they are matched they end up higher than better matches in the rest of the targets (description, seo, etc)
- Added some css changes for hovers, scroll-bar considerations in overflows etc.
- Added category display, where if belonging to multiple categories, the best match is shown
- Added category search with option to disable
- Added infopage search with option to disable
- Added option to show "Show All and Advanced Search links" top/bottom
- Added logic to scan into matched descriptions and show deeper matches with '...' match text '...' (Thanks Eddy)
- Added configs for many areas to control number of matches, length of description text, some colors, js lost focus delay, and many others.

I think it's getting close to moving it into a configurable mod. I think there are too many settings for a normal mod, might move to an admin tool page as it'd just be nice to see all settings on 1 page without having to scroll them on the right of a normal module?

More input welcome ;)
Zip
zipurman
-----------


Join The Code Co-op to get access to your library in the Code Co-op Forum
Moxamint
Member
Posts: 93
Joined: Fri Nov 06, 2020 10:36 am
Phoenix Version:
Has thanked: 33 times
Been thanked: 3 times

Re: advanced search by type ahead

Post by Moxamint »

zipurman wrote: Sat Jan 28, 2023 11:06 pm might move to an admin tool page as it'd just be nice to see all settings on 1 page without having to scroll them on the right of a normal module?
This sounds great! Eddy
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: advanced search by type ahead

Post by heatherbell »

zipurman wrote: Sat Jan 28, 2023 11:06 pm - Added configs for many ... others.
Does this include option to show/not show the different elements in the results dropdown? e.g. Image, Model, Price, Category, SEO Description etc
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: advanced search by type ahead

Post by zipurman »

heatherbell wrote: Sun Jan 29, 2023 7:18 am Does this include option to show/not show the different elements in the results dropdown? e.g. Image, Model, Price, Category, SEO Description etc
Some of those have settings already, I will add the Price as well as the Image as options as well ;)
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: advanced search by type ahead

Post by zipurman »

Have added some more to the logic:

- Moved all sorting to SQL as I had some in php
- Added options for show image, price, category, description
- Added options for search description, seo_description

If you have a large database, searching all areas can be pretty slow. I have tried on a DB with >10000 products and it's fast as long as you limit the number of searched areas. Since this is using LIKE matching in the SQL with %text%, there is only so much that can be done for speed without getting into caches etc.

I will code the admin tool for this and get it released this week. Again it'll be free :)
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: advanced search by type ahead

Post by zipurman »

As promised:
app.php/addons/free_addon/search_type_ahead/

Let me know if any issues. Tested on 1.0.8.20

Enjoy!
zipurman
-----------
User avatar
Pierre_P
Contributor
Posts: 144
Joined: Fri Mar 12, 2021 5:06 am
Phoenix Version: v1.1.0.6
Has thanked: 21 times
Been thanked: 11 times

Re: advanced search by type ahead

Post by Pierre_P »

Fabulous!

Just 2 things to ask:
Leave as Default ∆ and Leave as Default ˚ settings seems to be swapped around in admin? Not sure if it will have effect though - pls confirm.

Is it possible to make the returned product search result row clickable instead of the product name or image?
If not clicking on the product name or image it will simply close the search.
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: advanced search by type ahead

Post by zipurman »

Pierre_P wrote: Fri Feb 03, 2023 7:06 am Fabulous!

Just 2 things to ask:
Leave as Default ∆ and Leave as Default ˚ settings seems to be swapped around in admin? Not sure if it will have effect though - pls confirm.

Is it possible to make the returned product search result row clickable instead of the product name or image?
If not clicking on the product name or image it will simply close the search.
Thanks ;)

New version coded. Will release ASAP ...
zipurman
-----------
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: advanced search by type ahead

Post by heatherbell »

zipurman wrote: Sat Feb 04, 2023 7:16 am New version coded. Will release ASAP ...
Small stuff but text is being overlaid when entering search term - see screenshot.
Untitled-040223.jpg
I have only been able to replicate this on your demo by entering search term and then clicking "x" in search box but it happens all the time on our test store installation. Not sure if the "predictive" text is helpful in our case anyway. Maybe it could be a configurable option?
You do not have the required permissions to view the files attached to this post.
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: advanced search by type ahead

Post by zipurman »

heatherbell wrote: Sat Feb 04, 2023 9:16 am I have only been able to replicate this on your demo by entering search term and then clicking "x" in search box but it happens all the time on our test store installation. Not sure if the "predictive" text is helpful in our case anyway. Maybe it could be a configurable option?
I will add the option. The spacing is based on the core/stock css that the search bar has. If the bar is styled differently it currently affects the type-head text. I have an idea to solve that ... will also add that soon ;)
zipurman
-----------


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply