Discussions

Ask a Question
Back to All

Searching in v3

Hi,

I would like to add search option to my site.
I can't find any help in the doc v3.

I'm trying to add somthing simple for the beginning like that:

{% assign query_string = 'two' %}

{% capture filter_query %}/{{ query_string }}/i{% endcapture %}
{% with_scope title: filter_query %}
{% assign posts = contents.posts.all %}
{% endwith_scope %}

I use regular expression but switch "i" doesn't work.
MongoDB docs says that I can use switch "i" as a param.

If I remove "i" switch I'll get some matching results - but with case sensitivity. I need to use "case insensitivity".

My questions are:

  1. Is it possible to use param "i" & "with_scope"?
  2. Is it possible to add search code more user friendly like the Locomotive v2 has?

Adam