title: Looking for best practice to filter suggestions from Completion Suggester
body: <p>I’m currently evaluating the Completion Suggester functionality in ElasticSearch to realize auto complete. It does look very decent so far. However I’m struggling a little bit with permissions. </p>
  
  <p>Let’s assume I have an index with hotels like the example on the ElesticSearch website. Besides getting the hotels that match with the given phrase I also wanna check whether the user is allowed to see the "suggestion" or not. Something like hotels which are for a certain clientele only. I added a new field for saving the group/permission just as a simple string for testing purpose. What I want to accomplish is to filter by the groups.</p>
  
  <p>The mapping would look something like that:</p>
  
  <pre><code>{
    "mappings": {
      "hotel" : {
        "properties" : {
          "name" : { "type" : "string" },
          "city" : { "type" : "string" },
          "group" : { "type" : "string" },
          "name_suggest" : {
            "type" : "completion",
            "payloads" : true
          }
        }
      }
    }
  }'
  </code></pre>
  
  <p>And with the following documents:</p>
  
  <pre><code>{
    "name" :         "Mercure Hotel Munich",
    "city" :         "Munich",
    "group "   :     "1",
    "name_suggest" : "Mercure Hotel Munich"
  }'
  
  {
    "name" :         "Monaco Hotel",
    "city" :         "Munich",
    "group"    :     "2",
    "name_suggest" : "Monaco Hotel"
  }'
  </code></pre>
  
  <p>So, if a user with the group “1” is entering “M” he should only get "Mercure Hotel Munich". Vice versa, a user with group “2” is typing in “M” he should only get "Monaco Hotel ". </p>
  
  <p>I’ve seen some similar posts on Stackoverflow regarding to Completion Suggester + filter and that it doesn’t work together. </p>
  
  <p>In my honest opinion it’s not an unusual use case that some documents are for certain users. Therefore I don’t want to suggest anything which the user is not allowed to access. </p>
  
  <p>So my question is: What is the best practice to accomplish this? I mean considering performance and maintainability regarding to upcoming ES versions. </p>
  
  <p>Shall we stick with the edgeNGram solution until <a href="https://github.com/elasticsearch/elasticsearch/pull/4044" rel="nofollow">https://github.com/elasticsearch/elasticsearch/pull/4044</a> is integrated? Or is there another solution by using completion suggester?</p>
  
  <p>TIA</p>