Multiple Swiftype search boxes - different behaviour

Is it possible to have 2 search inputs on a single page where one have autocomplete enabled and the other doesn’t?

Ideally without having to write my own customisation :smiley:

I would like to know the answer to this question, as well.

Using the Swiftype Jquery implementation, this is very easy - you can enable autocomplete selectively on each search box field. The Jquery API is only a few lines of code more than the embedable code they provide on the website and markedly more flexible in what you can do with it.

Chad we have two search engines (one at the site level, the other at the directory level, say /abc/) configured mapping to search field etc. The site level search field is at the header whereas the directory level search field is in the body. Both site level and directory level search will need to work for the pages under /abc/. How can this be implemented?

It’s basically the same answer. Using the Jquery API from Swiftype you can add two search boxes to the same page. Each one has an Engine ID - so you can point one to one engine and the other to the other engine.

1 Like

Chad, the ‘install search’ script has been included, for both the searches, in the pages at the directory level, still only one search works. The _st(‘install’,,‘2.0.0’); has been included in all pages and the pages with two search fields this has been added twice.
In addition I would like to mention that we would like to carry out the configuration using swiftype admin tool and avoid any programmatic approach.

@chad.johnson I have successfully implemented this (two searches on one page, connected to different engines) but the issue I am having is that results from one search are showing up in the second search results box elsewhere on the page. I believe its because of the code that get appended to the url e.g. “#stq=test&stp=1”.

Is there any known solution for this issue?

3 Likes

Also running into this problem.

What’s striking is that the ajax response of the search results is available. It seems that it just isn’t appended to the page.

From what I can tell as a user, the fact that “#stq=test&stp=1” and _st(‘install’,,‘2.0.0’); appear in the discussion means that you are trying to use the default “customizable widget” AND the jQuery one together.

I too would like to know if it is possible, but it certainly seems like they are not compatible.

It’s a shame, because I like the styling and the automatic modal functionality of the customizable widget (the “#stq=test&stp=1”), but I need to run 2 searches, one with a filter.

Also, I’ve no idea how to filter results using the customizable widget, using the “updated” code version (the one with the _st(‘install’,,‘2.0.0’);.