title: Sorting not working in elastic search
body: <p>I am creating an index with elastic search and want to be able to sort on the "field" country_en (I might want to add another field later). However the sorting result is not correctly. </p>
  
  <p>A descending order would return</p>
  
  <ul>
  <li>Czech Republic</li>
  <li>Germany</li>
  <li>France</li>
  <li>Finland</li>
  <li>Czech Republic</li>
  <li>Czech Republic</li>
  <li>Germany</li>
  <li>United Kingdom</li>
  </ul>
  
  <p>When I sort ascending the order is different again, but not on alphabet.</p>
  
  <p>The command I give to create the index is:</p>
  
  <pre><code>curl -XPUT "localhost:9200/_river/tenders/_meta" -d '
  {
    "type": "mongodb",
    "mongodb": {
      "servers": [
        { "host": "127.0.0.1", "port": 27017 }
      ],
      "options": { "secondary_read_preference": true },
      "db": "jna",
      "collection": "tenders"
    },
    "index": {
      "name": "tenders",
      "type": "string",
      "bulk": {
            "concurrent_requests": 2
      }
    },
    "mappings" : {
          "country" : {
              "_source" : { "enabled" : true },
              "properties" : {
                  "country_en" : { "type" : "string", "index" : "not_analyzed" }
              }
          }
      }
  }'
  </code></pre>
  
  <p>The search is done via the elastic search PHP library. The command is an array but I converted it to JSON using PHP json_encode.</p>
  
  <pre><code>{
    "body": {
      "query": {
        "bool": {
          "must": [
            {
              "query_string": {
                "default_field": "_all",
                "query": "Liability*"
              }
            }
          ]
        }
      },
      "from": 0,
      "size": "25",
      "sort": {
        "country_en": {
          "order": "asc",
          "ignore_unmapped": true
        }
      }
    }
  }
  </code></pre>
  
  <p>Data that is being indexed</p>
  
  <pre><code> {
     "_id": ObjectId("53bd88db557acd276d8b4d5f"),
     "userid": null,
     "importdate": ISODate("2014-07-09T18:24:27.0Z"),
     "documentnumber": "230476-2014",
     "source": "ted",
     "typeoftender": "public",
     "categories": {
       "0": ObjectId("5210c86d9b7e7a3803000010")
    },
     "data": {
       "oj": "129",
       "ol": "de",
       "cy": "de",
       "ds": "0.00000000 1404424800",
       "dt": ISODate("2014-08-10T22:00:00.0Z"),
       "aa": NumberLong(1),
       "td": NumberLong(3),
       "nc": NumberLong(2),
       "pr": NumberLong(2),
       "ty": NumberLong(1),
       "ac": NumberLong(1),
       "heading": "01202",
       "cpv": {
           "0": "33600000"
        }
    },
     "type": "public",
     "title_en": "Pharmaceutical products",
     "category_en": "Pharmaceuticals",
     "country_en": "Germany",
  }   
  </code></pre>