title: Azure Search Order
body: <p>We have a search screen where the user can enter a phrase and then search Azure for rows that contain the phrase or any words of the phrase. They want to see the results ordered by the rows that contain the entire phrase first followed by rows that contain any or all of the words that make up the phrase.</p>
  
  <p>This is my search string that I am testing with in Search Explorer in portal: </p>
  
  <p><code>search="\"cause and healthcare\""  cause and healthcare&amp;queryType=full&amp;searchMode=any
  </code></p>
  
  <p>So in this example they want to see rows that contain the phrase "cause and healthcare" first and then any rows that contain  any/all of "cause" "and" "healthcare"</p>
  
  <p>When I run the above query in the Search Explorer in Azure portal, it "seems" to return the rows with the entire phrase first followed by the others in no particular order. But I am getting a different order when I run from from dotNet:</p>
  
  <pre><code>       SearchParameters parameters = new SearchParameters()
          {
              Filter = newFilter,
              QueryType =  QueryType.Full,
              Top = recordsPerPage,
              Skip = skip,
              SearchMode = SearchMode.Any,
              IncludeTotalResultCount = true
          };
          query = string.Format("\"{0}\" {0}", query);
  </code></pre>
  
  <p>I have looked at term boosting in the Search Explorer by putting ^2, ^4 etc. within the search string but that doesn't seem to have any impact.</p>
  
  <p>Ideally I would like the rows that contain the entire phrase returned first, followed by rows that contain the first word, followed by rows that contain second word etc.</p>
  
  <p>How can I change my code to ensure the rows are returned in the specified order?</p>