Shopify Search Parameters

Shopify Search Parameters

Rate this article

Share this article

Hey, are you looking for the Shopify search parameters or just about search parameters in general? Well, look no more as we have covered everything about Shopify search parameters and more.

shopify search parameters

Shopify Search Parameters 101

search parameter also called a search parameter is basically a bunch of or string of characters.  Used by a search  engine query to pinpoint the focus of the user’s search. The other search parameters are generally placed around or in front of the query search bar. Always without any gap.

Talking about the search bar for your online Shopify store. Take a look at Expertrec’s blazing fast, error-prone, and instant indexing search bar with voice optimization. Of course, it comes with amazing 24×7 customer support and a trial for you to try out. If you like it you can opt for premium for just $9!

Expertrec Shopify Search Bar

 

Search Parameter Basics

Taking general consideration these parameters are basically a bunch of characters or a series of characters that is used to represent an action. That is yet to be performed or used to represent an action. You will find that in searches the most commonly used type of parameter is boolean. For example, the parameter “AND” is used when a webpage is needed to display two entities. Shown in a search together like text and picture.

It can also contain the searched text and the continuation of relevant results or it can directly show the results with pictures to make it convenient for the website visitor. Similarly, the  “NOT” parameter is used when you do not want the page to display certain elements in the search result. For example, the search result should not contain the searched phrase or should not contain any image of a certain category. You can use the “OR” parameter to make sure the search results include any of the terms on either part of the searched phrase rather than the results that contain the whole searched phrase. In this way, you can diversify the search results and generate more engagement.

Search Parameters Examples

The other search parameters are usually placed directly in front of a searched phrase or query word or, with no intervening space. Multiple parameters can be combined in a query to further narrow the focus of a search.

  • “site:” The parameter is followed by a domain name or the website’s URL. Using this parameter will return the files on the domain. You have to use the parameter without any space in between. 
  • “filetype:” This is followed by the type of extension of a file that you will specify. For example using this parameter you can search for specified types of files like “.doc”, “.pdf”, “.ini”, “.xls” and etcetera. You can also search for multiple types of files by separating the extensions with “I”.
Key Examples 
  • “inurl:” After the parameter, the extension is followed by a specific string that will return you the results with the sequence of characters present in the URL.
  • “intext:” This parameter is followed by the words you have chosen and the search phrase returns files with the same string that is present anywhere in the text.
Parameters Uses

Above are examples of advanced search parameters: These search parameters can be integrated into a search phrase or query to refine a search. There are complex search engine queries that are sometimes referred to as a Google dork queries. This is used sometimes to find information that is not intentionally made available by a site admin or owner. This application is also known as Google hacking. This is generally recommended as a way to discover the vulnerabilities of a website which helps in the implementation of its patches.

 

Search String

shopify search parameters

A search string is the combination of characters and words that make up the search being conducted. For example, if you were searching for computer help and typed “computer escape key” in Google, an Internet search engine would be your search string.

Search Parameter Structure

When you enter a search phrase or term on an online website, the page URL is updated accordingly to include information about the search. The basic URL structure including your search term in the online store is:

/search?q=

The following example is to show a search URL that includes the options the website visitor has opted for. You can see the parameters described below:

/search?q=snow&type=product,page&options[unavailable_products]=hide&options[prefix]=last

Query parameters

The search URLs generally contain the following query/ search phrase parameters.

Query Parameter Type I

Query Parameter: q 
Type: String
Description: The search query.

Query Parameter: type
Type : Comma-separated values
Description: Specifies the type of results that are requested. The general valid values are product, page, and article. Defaults to all types.

Query Parameter: page 
Type: Integer
Description: Specifies the current search results page. It defaults to 1.

Query Parameter: options 
Type: Hash
Description: Specifies the search options that are available and you can customize with the unavailable_products and prefix settings.

Query Parameter Type II

Query Parameter : unavailable_products 
Type: String
Description: This is to specify whether to display results for unavailable products. The three possible options are shown, hide, and last. You can set it last to display the unavailable products below other matching results. You also can set it to hide to exclude the unavailable products from the search results. The default is last.

Query Parameter: prefix 
Type: Comma-separated values
Description: This specifies whether you want to perform a partial word match on the last search term. The possible parameters are none and last. You can set it to last to auto-complete the last term. For example, if a search query is made on “waterproof coating”, a search will be made on all resources that contain both the term “waterproof” as well as a term that starts with “coating” such as “coating paint”, “coating primer”, or “coating types”. You can set it to none and the search will make sure to not auto-complete on the last term. By default, it is none.

Is this too complicated? Fear, not Expertrec has got you covered. They offer a blazing fast highly customizable search bar for your online Shopify store. It does not matter if you have knowledge about the Shopify search parameters. With Expertrec’s very easy-to-use graphical user interface you need not worry about the best search bar optimization, the search bar does it for you!

Search Parameters Optimized Bar

Search Query Grammar

search query grammar

A string of queries is basically a group of text used to search. To the website visitors, it is plain text. But to us, it is made up of terms, connectives, modifiers, and comparators. The rules defined for the search query grammar here can be used to be built into larger structures.

Search query grammar is defined similarly to the Extended Backus–Naur form and uses some of the baseline terminal symbols that I have mentioned below:
1. Item: whitespace
Description: Well, any sequence of space, tab, or newline characters is basically white space.
2. Item: name
Description: This is any sequence of non-whitespace, non-special characters. See Special characters for more information.
3.Item: value
Description: In value any name or any quoted string (you can use single or double quotes as both are permitted).

Grammar Type I

  • Query

With grammar in perspective, the query is the root. For example:
Query = Term { [ whitespace Connective ] whitespace Term }
As you see one or more terms can be separated by white space and sometimes optionally by a single connective, it is proper query grammar. Sometimes a query may have a few optional leading and a few trailing white spaces.

query=John Smith

  • Connectives

Connective = "AND" | "OR"
Now if you do not imply a connective between two entities or terms then an AND is implied.
query=state:enabled OR state:disabled

  • Terms

Term = [ Modifier ] ( "(" Query ")" | [ name Comparator ] value )
The structure of a term generally consists of an optional modifier that is followed by either a sub-Query which is enclosed by parentheses or a value with an optional name-and-Comparator.
query=-first_name:Bob AND orders_count:>3 orders_count:<=4

Grammar Type II

  • Modifier

Modifier = "-" | "NOT" whitespace
The modifier can be “-”  and in that case, it cannot be followed by any white space or it may be “NOT”. Therefore it can only be followed by white space. Here both are vice versa but they mean the same thing.
query=-first_name:Bob

  • Comparators

Comparator = ":" | ":<" | ":>" | ":<=" | ":>="

The current list of comparators is:

: means equality*
:< is less-than
:> means greater-than
:<= is less-than-or-equal-to
:>= means greater-than-or-equal-to

The equality generally depends on how well the field is indexed. For example, numeric fields: represents equality. Now for tokenized fields, can equality exist only if the term is found anywhere in the field? And for a non-tokenized field, the search query string or phrase has to match the searched field exactly.

Search query syntax

The Shopify search query syntax is based on the defined grammar and will enable you to implement the following search behavior.

Syntax I

  • Term search

The term searches will make the case-insensitive search appear in any field in a document present on the search result page.

query=Mark Newman

Now this will make it a case insensitive search for both the entity “mark” AND the entity “Newman”.

  • Field search

The field searches apply to all the terms but in specific fields.
query=first_name:Vance age:25
In this query, the visitor will search for “Vance” in the “first_name” field “AND” “25” in the “age” field. Now the value must immediately follow the next field with no white space: first_name: Vance will basically search for the terms “first_name” and “Bob” because as you can see there is white space after the first name field.

  • Range search

The range search generally specifies the range of values that you can search against.
query=orders_count:>25 orders_count:<=30
The query will match the documents where the orders_count field is greater than 25 and less than or equal to 30. The supported operators in this type of query are >, >=, < and <=.
The equality is done as orders_count:16, not as orders_count:=16; because the latter will end up searching for the term “=16” in the orders_count field.

Are you wondering if your search bar can take care of the search syntax efficiently? Retain your website visitors and positively impact your conversion rate. I got bad news for you if you are using a default search bar as they are not built with efficiency in mind. The default search bar is more of a formality. Let Expertrec worry about the correct syntax and optimization. While you focus on your Shopify store, Expertrec’s search bar takes care of:

  • Instant auto-Indexing.
  • Error-prone search.
  • Voice optimized searches. Yes!

Their 24×7 customer support will take care of any other customization you might have in your mind. Get your trial today!

Voice Optimized Search Bar

Syntax II

  • Not query

The not query basically excludes documents that include the “NOT’ parameter.
query=-man
query=NOT man
Now both of these queries will not return the documents that contain the term “man” in the search results.
The “NOT” parameter has to be capitalized for it to work and to execute a Not Query. This only applies to the following space-separated term or query. And the minus sign has to come before the field, the value, and the or subquery
For example -field:value -value -(subquery).

  • Boolean Parameters

The boolean parameters will allow you to merge the terms by using logic operators.
query=Phil OR Oliver AND Shopify
The search parameter will search for the documents that have to have the specified term “Shopify” and it needs to have at least one of the search phrase terms “Phil” or “Oliver”.
query=bob OR norman Shopify

Now this query is equal to the first query since the parameter “OR” has higher operator priority than the “AND” parameter. Also, the default boolean parameter between the terms or queries is “AND”. Therefore no explicit “AND” parameter is needed.

  • Grouping

Your online Shopify store supports the use of parentheses to different group clauses so subqueries can be formed.
query=state:enabled AND ("discount sale" OR VIP)
The above search query searches for enabled clients with tags of discount sale or VIP.

Syntax III

  • Phrase query

A Phrase is basically a bunch of words closed by double quotes
query=first_name:"John Newman"
The query will search for the term “John” and then will be followed immediately by the term “Newman” in the “first_name” field. A phrase query can be used outside of the field query, for example, “John Newman”.

  • Special characters

Good news! Shopify also supports the ability for the search query to escape any special characters using the “backslash escaping”. Special characters supported currently are 
: \ ( )
The Search queries having names has the ability to include the characters of -, ‘, and ” but users cannot begin the search with them. The names can include the escaped characters by using the backslash escaping.

  • Exists query

The ‘Exists query’ will help you in matching documents only with a non-NULL value in the specified search field. The structure of the field is given below:
query=published_at:*

UTM

This type of query can be integrated with a “Not” query to find the fields that are missing a value, for example -published_at:*

The Urchin Tracking Module (UTM) parameters are basically five different types of URL parameters that are used by usual marketers to track the success of their online advert campaigns across multiple traffic sources and other publishing media outlets. The UTM parameters are used to identify the campaign that points the website traffic to a specific web address and allocate it to the website session and the sessions of the browser till the time the advert window times out or expires. The UTM parameters can be used by analytics tools like Google Analytics and can be used to generate reports.

UTM Shopify Search Parameters

Note: You must use the UTM parameters when setting the permalinks for your posts. This will help you in saving time. Follow the steps below to add the UTM parameters in your

mentioned steps

  1. From your Shopify admin, go to the Online Store section
  2. Now head to the Themes section.
  3. Select the theme you would like to edit.
  4. Now click on Actions and head to the Edit code section.
  5. In the Layouts section, search for the themes.liquid file to open it in the online code editor.
  6. Using the online code editor, you can add the code below before the close </body>  tag.

 

<script type='text/javascript'>
$(document).ready(function(){
    $('a').each(function(){
        var href = $(this).attr('href');
    if(href.indexOf("?") > -1) href = href + "&";
    else href = href + "?";
    href = href + "utm_source=huratips.com&utm_medium=huratips.com&utm_campaign=huratips";
    $(this).attr('href',href);        
    });
});
</script>

Now click Save and you are done.
Note: Remember to load the jQuery library first.
Please be advised to change the code according to your theme and needs as this will not work for all current running themes.

With this we have covered everything there is about Shopify search parameters. I hope you liked it.

Are you showing the right products, to the right shoppers, at the right time? Contact us to know more.
You may also like