Need info from Treepl Team re: Search Queries

Hey guys, have been asked this quite a bit from clients, and as much as I like ‘making shit up’, I would like to know exactly how the Site Search Functionality works, in particular, what info is it querying… (I would appreciate the info coming from the Treepl team).

When using the Site Search functionality, is it posting results from the:

  • Item Name (ie. Page or Module Item Name) - YES OR NO?
  • Item URL (i.e. Page or Module Item Name) - YES OR NO?
  • Item Description (i.e. Page or Module Item Description) - YES OR NO?

Also, when using the generic site search, with the source set to “Page”, is this only pulling search results from the Pages, or the whole site, i.e. Content/Blogs, Content/FAQ, Custom Modules?

Again, I am getting these questions from clients of live sites, as it doesn’t seem that the site search is working as well as it should. For instance, a client recently posted a blog with the word “SME” in the Blog Title, yet that item does not show up in the site search results when “SME” is typed in the search field. Now, I’m sure it would be there if the pagination worked, and I set the sortBy to DESC… but this is not a good solution to have to sort items. Explicit, or closest match keywords should always appear at the top of the list!!! this seems obvious. https://sharonperry.ca/ type the search query “SME”.

Lastly, is there anyway of targeting site search result keywords, like BC did? i.e. any item in the search results that had the keyword of the search term, you could “bold” it.

Looking forward to a quick response here.

Thanks,
Aaron

1 Like

Hi @A3CS
Answering your questions:

  • Item Name (ie. Page or Module Item Name) - YES
  • Item URL (i.e. Page or Module Item Name) - NO
  • Item Description (i.e. Page or Module Item Description) - YES
    Keyword field is used to search by those two fields only

It pulling results from all modules, not only from the Page. The reason for that “Page” is to determine what module should be used to find the list layout of the search results.

So if you want to use list layout from some another module - just paste It’s name under source param.

We are working on indexing and search improvements. Basically current sprint will bring advanced search for modules Screenshot by Lightshot (but it also affects the site search indexing and search) that should fix the issue.

Right now you can do it with the help of liquid. Just replace the name and the description on the search result list layout using the code below:

{% assign keyWords = request.request_url.params.searchkeyword | split: " " %}
        {% assign description = this['Description']  %}
        {% for keyWord in keyWords %}
            {% assign boldKeyword = "<strong>" | append: keyWord | append: "</strong>" %}
            {% assign description = description | replace: keyWord, boldKeyword %}
        {% endfor %}
        {{description}}

AND the same for the name:

{% assign keyWords = request.request_url.params.searchkeyword | split: " " %}
{% assign itemName = this[‘Name’] %}
{% for keyWord in keyWords %}
{% assign boldKeyword = “” | append: keyWord | append: “” %}
{% assign itemName = itemName | replace: keyWord, boldKeyword %}
{% endfor %}
{{itemName}}

5 Likes

Awesome thanks @vlad.z appreciate the info!