Type 0 – Request Parameters

Named Type 0 as there really isn’t any SEO friendly encoding, this method relies on the base URL with request parameters only. So, starting with the following search parameters:

  • The title and/or body text contains the term ’super’ – i.e. the query string is ’super’
  • The DVD must be in the category of ‘action’ and ‘drama’
  • We want to sort on price
  • The DVD edition must be a special
  • We want 25 results per page

With this encoding1, the url for the above search would look something along the following lines:


http://example.com/search.jsp?
  query=super&
  cat=action&
  cat=drama&
  sort=price&
  edition=special&
  num=25

NOTE: the URL was broken up over multiple lines for readability’s sake – in the browser address bar this would of course be contained on a single line

From the above URL and query parameters, the only hint that can be gained is that this page is to do with search and in fact the jsp page name could be changed to dvd-search.jsp to provide greater relevancy to the returned content. This will be left as the simple search.jsp for the following examples.

From the URL:

  • the query parameter is ‘super’
  • the cat is both ‘action’ and ‘drama’
  • the sort order is by price – note that this is considered to be descending for price, although another parameter could be included – e.g. order=asc(ending) or order=desc(ending)
  • the edition is set to ‘special’
  • and the number of results per page is 25. Note: depending on the implementation, there are various ways to indicate which page of results the user is looking at.

The encoding is not particularly SEO friendly, and depending on who you speak to, the SEPs do or do not parse the query parameters, or perhaps only parse a certain number (as yet not absolutely defined). Nevertheless, this is the most basic of encoding – if indeed it could be called encoding. You will also notice that there is extra information within the URL, specifically the query keys which provides information to the search appliance in retrieving the parameters, but for SEPs this redundant data makes the URL longer and may not provide any extra help with SEO.

How any ‘out-of-the-box2‘ SSA3 works

An SSA looks at the query parameters that are sent through which is then passed into the search implementation. The result is a list of documents / pages / etc. that match the query. Writing in pseudo-code4 an implementation would look something along the following lines:


SearchEngine searchEngine = SearchEngineFactory.getSearchEngine();
searchEngine.setQuery(getQueryParameter("query"));

Vector categoryParameters = getQueryParameters("cat");
searchEngine.setCategories(categoryParameters)5;

searchEngine.setEdition(getQueryParameter("edition"));
searchEngine.setSort(getQueryParameter("sort"));

int numResults = Integer.convertToInt(getQueryParameter("num"))6;
searchEngine.setNumberOfResults(numResults);

SearchEngineResults searchEngineResults = searchEngine.getResults();
return(searchEngineResults);

The searchEngineResults object contains all of the information that is required to display the documents/pages/etc. that are returned, along with performance metrics about the search that was performed, total number of results and possibly any facets that are applicable to the results.

If you do a Google search for say “synapticloop” the URL is as follows:

http://www.google.com/search?client=safari&rls=en-us&q=synapticloop&ie=UTF-8&oe=UTF-8

As you can see, Google uses the default Type 0 encoding for their results. The reason why I mention this is that when you have a search box and you submit your query, the result is always7 going to use request parameters. Consequently, our SSA must not only be able to use the request parameters, but also be able to decode some of the encodings we are going to investigate. This is for another time, although methods for implementation will be touched upon in later encoding types.

Search results pagination

Although not really a part of the encoding discussion, it is worthwhile to take a brief segue into paging of results as the pagination is generally done through query parameters.

Broadly speaking, there are two methods which are inter-related.

1. Start result and number of results per page

If there are 100 results, the query is broken up into the start of the current result number and shows the number of results specified. So the URLs for the 4 pages would be as follows:

Page 18:
http://example.com/search.jsp?start=0&num=25
Page 2:
http://example.com/search.jsp?start=25&num=25
Page 3:
http://example.com/search.jsp?start=50&num=25
Page 4:
http://example.com/search.jsp?start=75&num=25

2. Page number and number of results per page

If there are 100 results, the query is broken up into the start of the current result number and shows the number of results specified. So the URLs for the 4 pages would be as follows:

Page 19:
http://example.com/search.jsp?page=0&num=25
Page 2:
http://example.com/search.jsp?page=1&num=25
Page 3:
http://example.com/search.jsp?page=2&num=25
Page 4:
http://example.com/search.jsp?page=3&num=25

Choosing a pagination method

No matter which choice is made, a strategy for an SEO friendlier URL must take into account these two parameters.

The number of results per page may of course be set at a suitable default value and omitted from the query parameter. To keep the ability to allow the user to choose how many results per page they would like, the value could always be set in a cookie – although not all users will accept them.

Up next

We will start looking at some fundamental concepts that will be used in Type 1 encoding and beyond. First we will take a slight detour if you will, a Segue into URL binding »

Navigation:

Use the following links to skip straight to a page, or browse through the pages one by one.

  1. The Site Search Appliance
  2. Type 0 – Request Parameters
  3. Segue into URL binding
  4. Type 1 – Throwaway URLs with Request Parameters
  5. Type 2 – Parsing Hint Positional URLs
  6. Type 3 – Hard-coded Positional Parameters
  7. Type 4 – Positional Parameters with Encoded Parsing Hints
  8. Type 5 – Extra Information Positional Parameters with Encoded Parsing Hints
  9. Encoding Type Showdown
  10. Final Note

Footnotes:

  1. or lack thereof
  2. Nowadays the out of the box solutions are getting to be more SEO friendly, although at the time of writing, some of the solutions still require configuration tweaking to work
  3. Remember that an ‘SSA’ is the search engine for a particular site – my default choice for this article is of course Apache SOLR
  4. Whilst it is based on Java, this is not the correct code – I hopefully have made it more readable for non Java coders.
  5. This is nowhere near what is done, but you should be able to get the idea
  6. Again, please be kind on my code – this is for illustrative purposes only
  7. unless you use some JavaScript jiggery-pokery
  8. note that pagination may either start with a 1 or 0
  9. note that pagination may either start with page 1 or page 0

Like my footnotes?
Want to add footnotes to your blog?
They can be added easily to your WordPress installation