Quote Originally Posted by dw08gm View Post
Please correct me if I am wrong, but you mean the AJAX search in ZCA Bootstrap Template.

As I thought instant search was also an AJAX search, I am interested in learning the difference between the two.

Was a version of the Instant Search mod incorporated into ZCA Bootstrap Template or is its search a completely different build?

Thanks
there are significant differences between the two. few points:

  • they are both ajax searches.
  • the display of results is different between the two; however this always somewhat customizable in your template.
  • the search logic, as in the guts of them, is very different.
  • the resources necessary to do said searches could be completely different.


i will only comment on the logic differences. the bootstrap template incorporated changes made to zc v158. prior to v158, zc searching was woefully inadequate. changes now make use of boolean matches of the words that are being searched. you can see the bootstrap logic here:

https://github.com/lat9/ZCA-Bootstra...ch.php#L23-L50

and see the similarities to the new zc (as of v158) function zen_build_keyword_where_clause here:

https://github.com/zencart/zencart/b....php#L163-L204

the instant search mod makes use of the mysql operator REGEXP which uses regular expressions. you can see some of that logic here:

https://github.com/marco-pm/zencart_...ch.php#L86-L92

i will not go on with a discussion of the power of regular expressions. i will suffice to quote something here from the 'net:

"What is the difference between RegExp and like in MySQL?
Basically, LIKE does very simple wildcard matches, and REGEX is capable of very complicated wildcard matches. In fact, regular expressions ( REGEX ) are so capable that they are [1] a whole study in themselves [2] an easy way to introduce very subtle bugs."

as the person responsible for the zen_build_keyword_where_clause, i think it is a vast improvement over previous searching in zc. however, i have implemented the instant search plugin on a few client sites, and i am duly impressed with its power and ability to provide excellent results. as previously stated somewhere, there are some potential performance pitfalls with instant search, but in general, i am a big fan of that plugin.

hope that helps.