Styla provides a Search module which lets you display search results from both product details as well as other content pages created with Styla Editor. The module uses an external API provided as the source of search results data, so you need a contract with such a partner (for instance: Algolia, Klevu, Findologic) that is able to crawl and index an .xml file provided by Styla and then provide search results API.
How this works
Styla automatically provides an .xml file with all content of your Styla Frontend that an external search solution can crawl and index all the links in it. The file is provided at location needed
You create a new config/index in your search solution and set it to use the above .xml file as data source
You configure API credentials so that your Search module can fetch search results from the new index and use render search results. You do this in the DOMAIN CONFIGURATION tab of your Styla Admin. For Algolia, the config looks like this:
Code Block "integrations": { "searchEngine": "algolia", "services": { "algolia": { "searchOnlyAPIKey": "", "adminAPIKey": "", "applicationId": "", "index": "" } } }
The
index
field is the name of the index/config you created in your search provider.You create a
/search
page in your Styla Editor and drop the Search module on this page:You include a search input sending your users to the above search results page in your website header custom module. You then drag the module on your Page Base.
The search input in your website header looks like this:
Search results delivered by the module look like this: