# Japanese autocomplete with App Search

**URL:** <https://discuss.elastic.co/t/japanese-autocomplete-with-app-search/275217>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [June 8, 2021, 12:34am UTC](https://discuss.elastic.co/t/japanese-autocomplete-with-app-search/275217 "2021-06-08T00:34:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zkirill](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zkirill/32/89957_2.png) [@zkirill](https://discuss.elastic.co/u/zkirill)\
**Post date:** [June 8, 2021, 12:34am UTC](https://discuss.elastic.co/t/japanese-autocomplete-with-app-search/275217/1 "2021-06-08T00:34:12Z")

</div>

I am performing search query tests as described in [Implementing Japanese autocomplete suggestions in Elasticsearch | Elastic Blog](https://www.elastic.co/blog/implementing-japanese-autocomplete-suggestions-in-elasticsearch) but not getting any of the expected results.

What does "language optimization" mean for App Search? Does it use the recommended plugins?

---

<div class="post-metadata">

**Author:** ![Irina\_Truong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irina_truong/32/112040_2.png) [@Irina\_Truong](https://discuss.elastic.co/u/Irina_Truong)\
**Post date:** [June 10, 2021, 7:39pm UTC](https://discuss.elastic.co/t/japanese-autocomplete-with-app-search/275217/2 "2021-06-10T19:39:26Z")

</div>

When you create a language-specific engine, AppSearch applies language-specific analyzers to the index containing engine's documents.

As an example, I create an engine called japanese-test with data from your article. Documents are stored in an index called `.ent-search-engine-documents-japanese-test`. The index has the following `analysis` settings:

```auto
{
          "filter" : {
            "front_ngram" : {
              "type" : "edge_ngram",
              "min_gram" : "1",
              "max_gram" : "12"
            },
            "bigram_joiner" : {
              "max_shingle_size" : "2",
              "token_separator" : "",
              "output_unigrams" : "false",
              "type" : "shingle"
            },
            "bigram_max_size" : {
              "type" : "length",
              "max" : "16",
              "min" : "0"
            },
            "bigram_joiner_unigrams" : {
              "max_shingle_size" : "2",
              "token_separator" : "",
              "output_unigrams" : "true",
              "type" : "shingle"
            },
            "delimiter" : {
              "split_on_numerics" : "true",
              "generate_word_parts" : "true",
              "preserve_original" : "false",
              "catenate_words" : "true",
              "generate_number_parts" : "true",
              "catenate_all" : "true",
              "split_on_case_change" : "true",
              "type" : "word_delimiter_graph",
              "catenate_numbers" : "true",
              "stem_english_possessive" : "true"
            },
            "ja-stop-words-filter" : {
              "type" : "stop",
              "stopwords" : "_english_"
            },
            "ja-stem-filter" : {
              "name" : "light_english",
              "type" : "stemmer"
            }
          },
          "analyzer" : {
            "i_prefix" : {
              "filter" : [
                "cjk_width",
                "lowercase",
                "asciifolding",
                "front_ngram"
              ],
              "tokenizer" : "standard"
            },
            "iq_text_delimiter" : {
              "filter" : [
                "delimiter",
                "cjk_width",
                "lowercase",
                "asciifolding",
                "ja-stop-words-filter",
                "ja-stem-filter",
                "cjk_bigram"
              ],
              "tokenizer" : "whitespace"
            },
            "q_prefix" : {
              "filter" : [
                "cjk_width",
                "lowercase",
                "asciifolding"
              ],
              "tokenizer" : "standard"
            },
            "iq_text_base" : {
              "filter" : [
                "cjk_width",
                "lowercase",
                "asciifolding",
                "ja-stop-words-filter"
              ],
              "tokenizer" : "standard"
            },
            "iq_text_stem" : {
              "filter" : [
                "cjk_width",
                "lowercase",
                "asciifolding",
                "ja-stop-words-filter",
                "ja-stem-filter",
                "cjk_bigram"
              ],
              "tokenizer" : "standard"
            },
            "i_text_bigram" : {
              "filter" : [
                "cjk_width",
                "lowercase",
                "asciifolding",
                "ja-stem-filter",
                "bigram_joiner",
                "bigram_max_size"
              ],
              "tokenizer" : "standard"
            },
            "q_text_bigram" : {
              "filter" : [
                "cjk_width",
                "lowercase",
                "asciifolding",
                "ja-stem-filter",
                "bigram_joiner_unigrams",
                "bigram_max_size"
              ],
              "tokenizer" : "standard"
            }
          }
        }

```

and here are the mappings for `my_field`:

```auto
{
          "type" : "text",
          "fields" : {
            "date" : {
              "type" : "date",
              "format" : "strict_date_time||strict_date",
              "ignore_malformed" : true
            },
            "delimiter" : {
              "type" : "text",
              "index_options" : "freqs",
              "analyzer" : "iq_text_delimiter"
            },
            "enum" : {
              "type" : "keyword",
              "ignore_above" : 2048
            },
            "float" : {
              "type" : "double",
              "ignore_malformed" : true
            },
            "joined" : {
              "type" : "text",
              "index_options" : "freqs",
              "analyzer" : "i_text_bigram",
              "search_analyzer" : "q_text_bigram"
            },
            "location" : {
              "type" : "geo_point",
              "ignore_malformed" : true,
              "ignore_z_value" : false
            },
            "prefix" : {
              "type" : "text",
              "index_options" : "docs",
              "analyzer" : "i_prefix",
              "search_analyzer" : "q_prefix"
            },
            "stem" : {
              "type" : "text",
              "analyzer" : "iq_text_stem"
            }
          },
          "index_options" : "freqs",
          "analyzer" : "iq_text_base"
        }

```

You can already see that `analysis` settings in AppSearch are not the same as in your article. Moreover, in the article, the queries that are used are not simple search queries. They aggregate the search results, and sort them by number of occurrences. You see how when you search for `日本`, it comes up on top, because there are 6 documents with that exact text? In App Search, when you use query tester to search for a substring, it does no do aggregations.

I hopes this helps.

---

<div class="post-metadata">

**Author:** ![zkirill](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zkirill/32/89957_2.png) [@zkirill](https://discuss.elastic.co/u/zkirill)\
**Post date:** [June 10, 2021, 8:00pm UTC](https://discuss.elastic.co/t/japanese-autocomplete-with-app-search/275217/3 "2021-06-10T20:00:08Z")

</div>

Thank you very much, Irina! I am beginning to understand.

Is it safe then to assume that we would not be able to achieve the same result with App Search as described in the blog post that I linked?

Also, based on the analysis settings it looks like no additional Elasticsearch plugins need to be selected while creating an Elastic deployment in order to use a language-specific App Search engine. This wasn't clear to us in the documentation but makes sense now.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 8, 2021, 8:00pm UTC](https://discuss.elastic.co/t/japanese-autocomplete-with-app-search/275217/4 "2021-07-08T20:00:54Z")

</div>

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