Modify Search Results to only search Product titles

Highlighted
Shopify Partner
40 0 2

Could someone please help me modify this form code to include the necessary 'title:' that needs to go right before the search term?  I am trying to limit the Search to product titles only. My understanding is that the query needs to look like this. I dont' know how to generate that in the form code below.

/search?q=title:snowboard
<form action="/search" method="get" class="input-group search-bar {{ search_bar_location }}" role="search">
<input type="hidden" name="type" value="product">
    <input type="search" name="q" value="{{ search.terms | escape }}" placeholder="{{ 'general.search.placeholder' | t }}" class="input-group-field" aria-label="{{ 'general.search.placeholder' | t }}">
  <span class="input-group-btn">
    <button type="submit" class="{{ search_btn_style }}">
      {% include 'icon-search' %}
      <span class="icon__fallback-text">{{ 'general.search.submit' | t }}</span>
    </button>
  </span>
</form>

 

 

 

1 Like
Shopify Expert
704 0 68

Hmmm...

I'm a million different people
0 Likes
Shopify Partner
40 0 2

It's already there, it's the second line of code after the form tag.

What I need is to prepend 'title:' before the search term.

0 Likes