title: Where should I add an (url encoded) querystring in my named route?
body: <p>In my asp.net-mvc ontroller I accept a bunch of form field values and from those create a string the Lucene library understands.
  Then I want to redirect to a get method that will show results depending on this lucene string.  </p>
  
  <p>The lucene string is in the pattern {fieldName1:value1 fieldName2:value2 ...}  </p>
  
  <p>my Global.asax has the following entry for the redirect target:</p>
  
  <pre><code>routes.MapRoute(
      "AdvancedSearch",
      "AdvancedSearch.mvc/{displayType}/luceneString",
      new { controller = "Search", action = "AdvancedSearch",
            displayType = "chip", luceneString = "" }
  );
  </code></pre>
  
  <p>So my controller catches the post, creates the luceneString and does the following:</p>
  
  <pre><code>return RedirectToRoute("AdvancedSearch", new
      {
          Controller = "Search",
          action = "AdvancedSearch",            
          displayType = "chip",
          queryString = Url.Encode("company:test name:testname")
       });
  </code></pre>
  
  <p>This gives me a 500: bad request.
  Even with one parameter it doesn't work. Even with the ":" it doesn't work.<br>
  I tried:</p>
  
  <ul>
  <li>AdvancedSearch.mvc/chip/company%3Atest+name%3AtestName</li>
  <li>AdvancedSearch.mvc/chip/company:test+name:testName</li>
  <li>AdvancedSearch.mvc/chip/company:test</li>
  <li>AdvancedSearch.mvc/chip/company%3Atest</li>
  </ul>
  
  <p>It only works if I change this url to take the queryString in the format of</p>
  
  <pre><code>AdvancedSearch.mvc/chip?q=company%3Atest+name%3AtestName
  </code></pre>
  
  <p>What should I do to get the encoding right without resorting to "?q="<br>
  If I have to use the querystring, how can I define such a thing in the route table? How do I go about to call redirect to it?</p>