Google Search Appliance (GSA) Sorting and Filtering

When working with the Google Search Appliance (GSA), sometimes the business requirements include sorting and/or filtering the results. Browsing the internet did not provide any helpful pointers for how to sort or filter the search results therefore I have written these instructions to use sorting & filtering easily with examples.

Sorting

The Google Search Appliance (GSA) has provided the tags to sort the results in ascending or descending order. Pages should have meta tags that provide the information to GSA box for crawling. Using those tags, sorting can be done.

For example 

If the web pages have a tag:

  1. <meta name="title" content="Sumit Bajaj::Passionate Technologist" /> 
The GSA URL should include a parameter to sort the results:
  1. &sort=meta:title:a (for arranging all results in ascending order w.r.t title)

  2. &sort=meta:title:d (for arranging all results in descending order w.r.t title)  
Similarly it can be sorted for other meta tags.

Filtering

Similarly sorting meta tags can be used for filtering as well. The Google Search Appliance (GSA) has provided the provision to filter the results too. Pages should have meta tags that provide information to the GSA box for crawling. These tags can be used for filtering the output.

For example

If web pages have a tag:
  1. <meta name="articledate" content="2014-10-12" /> 
The GSA URL should include a parameter to filter the results.
  1. &query=inmeta:articledate:daterange:2014-01-01.. (all article whose articledate is greater than 2014-01-01)

  2. &query=inmeta:articledate:daterange:2013-01-01..2014-01-01(all article whose articledate is in between 2013-01-01 & 2014-01-01)

  3. &query=inmeta:articledate:daterange:..2014-01-01 (all article whose articledate is lesser than 2014-01-01) 
Similarly we can modify the tags and syntax to get the desired output.

Reference

Google Search Appliance document

For more details, you can contact me on "[email protected]" or visit my website:

http://www.bajajsumit.com

Enjoy coding and build the best.

Sumit Bajaj 


Similar Articles