Use analyzer in Completion Suggester

I have a question when using the analyzer in Completion Suggestion.
I understand that CS performs the prefix search. Shouldn't the analyzer allow you to search for another term in the text other than the first?

{
  "settings": {
      "analysis": {
      "filter": {
        "catalog_auto_complete_filter": {
          "type": "shingle",
          "min_shingle_size": 2,
          "max_shingle_size": 4
        }
      },
      "analyzer": {
        "catalog_auto_complete_analyzer": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "asciifolding",
            "catalog_auto_complete_filter"
          ]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "suggest": {
        "type": "completion",
        "analyzer": "catalog_auto_complete_analyzer",
        "search_analyzer": "catalog_auto_complete_analyzer"
      },
      "title": {
        "type": "text"
        }
      }
    }
  }
}

Data

{
    "title": "Avatar - Film of James Cameron",
    "suggest":[{ "input" :"Avatar - Film of James Cameron", "weight": 10},{ "input" :"James Cameron", "weight": 8}]
  }

Query

{
  "_source": "title", 
  "suggest": {
    "suggest_movie": {
      "prefix": "Cameron",
      "completion": {
        "field": "suggest",
        "size":5,
        "fuzzy": {
          "fuzziness": 1
        }
      }
    }
  }
}

The result is always empty for "Cameron". Shouldn't using the analyzer work?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.