advanced_site_search
This component outputs data relating to an advanced search request passed in a URL parameter SemanticQuery to any page (typically from a search form submission).
{% component type: "advanced_site_search", source: "<Your Advanced Search Name>" %}
Search queries can be configured against one or more of the following modules:
- Pages
- Blogs (Blogs and Posts)
- Events (Groups and Items)
- Banners (Groups and Items)
- Galleries/Sliders (Groups and Items)
- FAQs (Groups and Items)
- Custom Modules
- Authors
- Products/Catalogs
Parameters and Options
advanced_site_searchThis is the name of the entity that needs to be used for the component retrieving function.
<path/to/layout>If an empty string, nothing will be rendered.
If paramater is not included, the default virtual layout will be rendered (see below).
{'$and':[{'$gt':{'Id':1234}},{'$lt':{'Id':9876}}]}Allows advanced filtering with combined (conjunctive) operators and multiple properties and is intended to be used for advanced filtering in place of the more simple filterBy parameter.
If the where parameter is used along with the filterBy parameter, where will be prioritised and filterBy will be ignored.
The filter syntax is expressed in JSON Query Notation.
Supported Conjunctive operators:
$and
$or
Supported Condition operators:
$eq
$not_eq
$contains
$not_contains
$in
$not_in
$gt
$gte
$lt
$lte
$starts
$ends
When constructing your component tag via the admin Component Manager, selecting the "Advanced Filtering" option from the "Filter Type" dropdown will add the where parameter and allow entering the filter value via a text field.
For more information and examples for this filtering syntax, see the API documentation here which uses the same filtering method.
10 (default)
<integer>0 (default)
<integer>true the offset is ignored.true (default)
falseThis is useful for avoiding pagniation affects for a specific component when multiple components of the same module are output on the same page and do use pagination.
false (default)
true<Your custom message>Liquid variables are supported here, although Liquid logic tags and HTML are not.
If using Liquid variables with filters added, be sure to change any double quotes to single quotes. For eg: emptyMessage: “{{ myVariable | prepend: 'Error: ' }}”
To use HTML in your empty message, first capture it using a Liquid capture, then insert the capture variable into the emptyMessage parameter.
item (default)
collectionitem returns each item iteratively, one after another, for output (generally, output to a container element with no need for looping through the data).collection returns all items as one collection for output (your container element and looping logic would be handled in the Components Layout).<yourLiquidVariableName>Your collectionVariable value must only contain English letters, numbers or underscores. Spaces or special characters are not supported.
<text string>0.5 (default)
<0.0 - 1.0>A search relevance threshold, to adjust the sensitivity of the matching algorithm. A higher value here will set stricter relevancy scores, and therefore limit the results returned if they are not as strongly matched to the the query.
Setting this value can require some trial and error to see how the AI perceives the type of content on your particular site. Ideal values may differ from site to site.
If you do not see any search results at first, try lowering this score until the results are optimal.
<your custom value>Your <customParameter> name must only contain English letters, numbers or underscores. Spaces or special characters are not supported.
You can use HTML as the value here, just be sure to change any double quotes in your HTML to single quotes.
Also, see here for a tutorial on using Custom Paramters.
Liquid Output
The below example has 2 sample items returned as search results.
A unique aspect of the Advanced AI Search feature is the ability to return multiple module sources in the one Liquid output object, while retaining all the unique data points (properties) of each item type. For example, one of the item samples below is from the Blog module, while the other is from a Custom Module, yet each maintian their distinct properties.
This uniqueness can pose problems if wanting to loop through all items and reference properties that aren't consistent across all items returned. However, you can use Liquid conditions to check the item type and adapt to different rendering conditions.
Common system properties and other common properties you've added to the Advanced Search configuration will, however, be consistent across all items.
{
"Params": {
"source": "services_team_search",
"layout": "/includes/ai-search-list.layout",
"minscore": "0.3",
"type": "advanced_site_search"
},
"Pagination": {
"CurrentPage": 1,
"ItemsPerPage": 10,
"NumberOfPages": 1,
"TotalItemsCount": 2
},
"Parent": {
"Id": 2314,
"Name": "Advanced Search",
"Url": "/search-results",
"Url_List": [
"/search-results"
],
"UrlSlug": "search-results",
"ParentId": 1522,
"ParentId_List": [
-1
],
"ParentName": "",
"ParentUrl": "",
"TemplateName": "",
"Module_Alias": "Page",
"Module_ID": 1522,
"Enabled": true,
"ReleaseDate": "2025-12-06T00:00:00",
"ExpiryDate": "2099-12-31T00:00:00",
"SiteSearchKeywords": [],
"Description": "...",
"Weighting": 0,
"DisableForSiteSearch": false,
"CreatedByMemberId": "0",
"ItemCategories": [],
"ItemCategoryIdList": [],
"ItemTags": [],
"Author": 0,
"Author_Name": "",
"Author_Url": "",
"Item_Rating": 0,
"ShowPageForSearchEngine": true,
"MetaTitle": "",
"SEOTitle": "",
"MetaDescription": "",
"CanonicalLink": "",
"SocialMetaTags": "",
"SeoPriority": 0.5,
"EnableAMP": false,
"AMPContent": "",
"OpenGraphProperties": {
"title": null,
"type": null,
"url": null,
"locale": null,
"image": null
},
"ExternalId": 0,
"Params": {
"type": "...",
"name": "...",
"content": "...",
"enabled": true,
}
},
"Items": [
{
"Id": 2280,
"Name": "DEMO HTML Post",
"Url": "/demo-html-blog/demo-html-post",
"Url_List": [
"/demo-html-blog/demo-html-post"
],
"UrlSlug": "demo-html-post",
"ParentId": 2279,
"ParentId_List": [
2279
],
"ParentName": "DEMO HTML Blog",
"ParentUrl": "/demo-html-blog",
"TemplateName": "DEMO Companion Site",
"Module_Alias": "BlogPost",
"Module_ID": 1534,
"Enabled": true,
"ReleaseDate": "2018-11-25T16:55:00",
"ExpiryDate": "2099-12-10T16:55:00",
"SiteSearchKeywords": [],
"Description": "<p>Orci phasellus egestas tellus rutrum tellus pellentesque. Sed enim ut sem viverra aliquet. Sed euismod nisi porta lorem mollis aliquam ut porttitor. Eget duis at tellus at urna condimentum mattis pellentesque. A condimentum vitae sapien pellentesque habitant morbi tristique senectus et. Viverra aliquet eget sit amet tellus cras adipiscing enim.</p><p><span class=\"fr-emoticon fr-deletable fr-emoticon-img\" style=\"background: url(https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/1f60e.svg);\"> </span> </p>\r\n",
"Weighting": 0,
"DisableForSiteSearch": false,
"CreatedByMemberId": "0",
"ItemCategories": [
"Group 1/G1 Sub Cat I/G1 Sub Sub Cat I"
],
"ItemCategoryIdList": [
1353
],
"ItemTags": [],
"Author": 2274,
"Author_Name": "DEMO Author One",
"Author_Url": "/demo-author-one",
"Item_Rating": 90,
"Image": "",
"ShowPageForSearchEngine": true,
"MetaTitle": "",
"SEOTitle": "",
"MetaDescription": "",
"CanonicalLink": "",
"SocialMetaTags": "",
"SeoPriority": 0.5,
"EnableAMP": false,
"AMPContent": "",
"OpenGraphProperties": {
"title": null,
"type": null,
"url": null,
"locale": null,
"image": null
},
"ExternalId": 0,
"Params": {}
},
{
"Id": 2262,
"Name": "CSS",
"Url": "/demo-web-technologies/css",
"Url_List": [
"/demo-web-technologies/css"
],
"UrlSlug": "css",
"ParentId": 2253,
"ParentId_List": [
-1
],
"ParentName": "",
"ParentUrl": "",
"TemplateName": "DEMO Companion Site",
"Module_Alias": "DEMOWebTechnologies",
"Module_ID": 2253,
"Enabled": true,
"ReleaseDate": "2018-11-24T16:54:00",
"ExpiryDate": "2099-12-10T16:54:00",
"SiteSearchKeywords": [],
"Description": "<p>CSS (Cascading Style Sheets) is used to describe presentation semantics i.e. how a document looks and feels.</p><p>It can be embedded directly inside tags (by using the <em>style</em> attribute) or inserted in the document head by using the <em>style</em> tag.</p><ul><div dir=\"ltr\"><br></div></ul>",
"Weighting": 0,
"DisableForSiteSearch": false,
"CreatedByMemberId": "0",
"ItemCategories": [],
"ItemCategoryIdList": [],
"ItemTags": [],
"Author": 0,
"Author_Name": "",
"Author_Url": "",
"Item_Rating": 0,
"MyCustomProperty1": "foobar",
"MyCustomProperty2": null,
"CustomDatasourceProperty": 2267,
"CustomDatasourceProperty_Name": "Null type",
"CustomDatasourceProperty_Url": "/demo-web-technologies/javascript/null-type",
"ShowPageForSearchEngine": true,
"MetaTitle": "",
"SEOTitle": "",
"MetaDescription": "",
"CanonicalLink": "",
"SocialMetaTags": "",
"SeoPriority": 0.0,
"EnableAMP": false,
"AMPContent": "",
"OpenGraphProperties": {
"title": null,
"type": null,
"url": null,
"locale": null,
"image": null
},
"ExternalId": 0,
"Params": {}
},
"ExternalId": 0,
"Params": {}
}
]
}
Virtual Layout
If not using any custom layout or collection, the default virtual layout will output as follows:
<div>
<h1>{{this['Name']}}</h1>
<div>
{{this['Description']}}
</div>
</div>
Accessing the Data
JSON Output
You can output the full JSON for your component data by referencing the root Liquid object {{this}} in your module’s layouts, or directly on your page, if using the collectionVariable parameter in your component tag.
For example:
{% component type: ... collectionVariable: "myData" %}
You can then render the JSON like so:
{{myData}}
For more details on using this approach, see Part 2 of the free ‘Learning Liquid Course’.
Rendering Property Values
This data is accessible in two main ways:
1. Using Liquid in the specified Layout via the this object.
{{this['name']}}
2. Directly on the Page or Template via a Liquid Collection if collectionVariable was added to the Component tag.
An example using collectionVariable with value "searchResults" is as follows:
{% component type: "advanced_site_search", source: "<Your Advanced Search Name>", layout: "", collectionVariable: "searchResults" %}
Looping through the collection to render all the item names in a list:
<ul>
{% for sr in searchResults.items %}
<li>{{sr['name']}}</li>
{% endfor %}
</ul>
Accessing a specific item within the collection. In this case the first item name (zero based index):
{{searchResults.items[0]['name']}}
