I am creating an advanced search page where there are about 20 search fields for a user to filter their search. My question deals with the query string, Is it standard web development practice to have say 20 parameters in a querystring?

The search results display large tables of data. Is there an alternative that still uses HTTP GET(querystring), if it is not standard? I would like the users to be able to bookmark their searches.

  • check out stackoverflow.com/q/4203686/866172
    – Jalayn
    Apr 3, 2013 at 12:52
  • What kind of search fields are they? Check boxes/radio buttons/drop-downs? Free text? This might influence your solution.
    – Andy Hunt
    Apr 3, 2013 at 12:52
  • They are drop downs and text fields
    – Rayshawn
    Apr 3, 2013 at 14:07
  • use POST and for book marks share a GET URL with a code that points to the same search with pre filled values. So the search values go to a db with the key shared in the short GET URL
    – tgkprog
    Apr 12, 2013 at 10:51

4 Answers 4


I would not worry about having this many parameters in a query. There is no restriction on number of parameters, only total length of the URL (as mentioned by others). Long queries with lots of parameters are commonly used by big-name websites. For example, it is easy to construct a 15 parameter query in Google Maps.

As long as GET makes sense for your case, and you don't have to worry about the character limit, I would use it.

Interestingly, Google Maps also doesn't worry about breaking the 2000 character limit. Here is the URL it generated for my tour of places with long names in the Philadelphia area:


This URL also works in recent versions of Internet Explorer, so perhaps this limit no longer exists. The information about the IE limit, linked above, goes back to a source from 2006, so the limit might have been gone for a long time.

Update: after further testing, I discovered that Chrome (!) chokes on this long URL. So maybe you should worry about it!

  • that is funny that it failed on chrome! but it looks like they use ajax once you get a smaller URL and write a larger text string in chrome
    – tgkprog
    Apr 12, 2013 at 10:46
  • @tgkprog, I found it rather ironic. Also mystifying. Who builds a modern application with an arbitrary 2000 character limit on something that has no specified limit? I can understand why a piece of software with a long history, like IE, might have that as an artifact of the days when 8MB was a lot of RAM, but why Chrome?
    – user82096
    Apr 12, 2013 at 10:49

It does seem a little odd to have so many items, I would have suggested using a post and putting the content in the data sent.

You however said you want to be able to bookmark the results page so I think you need to keep it in the query string as you're doing. Do consider however that the query string has a max length in most browsers, e.g. IE is limited to 2048 characters, which might be a problem. See - https://stackoverflow.com/questions/812925/what-is-the-maximum-possible-length-of-a-query-string

  • to book mark can make a shorter URL keeping a code in your a public data base that points to a page with the search values pre filled and results shown
    – tgkprog
    Apr 12, 2013 at 10:50

As explained in a related SO question, there's technically no limit to the length of a URI, however IE 8 and below only supports up to 2083 characters, so if there's a possibility that your search page could generate a URL longer than that, you should implement bookmarking another way.

This page has some suggestions for how to work around the practical URL length limit while still allowing bookmarking:

  1. If your field names take up too much space, use a fixed field order instead
  2. Squeeze out any field that doesn't really need to be bookmarked
  3. [A]void large decimal numbers - use only as much accuracy as you must, and consider a base-64 representation using letters and digits
  4. In extreme cases, consider using the gzip algorithm to compress your pretty but excessively long URL. Then reencode that binary data in base64 using only characters that are legal in URLs
  5. An alternative is to store the state information in a file or a database. Then you can store only the identifier needed to look up that information again in the URL

Standard practice would generally be to allow the parameters to all be in the query string. However, you find that the browser limit is being exceeded, you do need to figure out an alternative system.

A possible solution would be:

  • use HTTP POST body to submit the arbitrarily lengthed data
  • cache these search parameters, and generate a unique ID for it
  • issue a browser redirect of the form http://[your_query_url]?query_id=[generated_id]
  • now, just make sure that you [your_query_url] can translate the ID into the query using the cache to seamlessly generate the response

To the user, this will be a seamless search, and they now will have a bookmark-able page. Depending on other real world requirements that you may have, this could be optimized to some extent to meet your needs, but it is a simple starting point that gets around browser limitations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.