# Indexing suggestions using analyzer

**URL:** <https://discuss.elastic.co/t/indexing-suggestions-using-analyzer/140934>\
**Category:** Elasticsearch\
**Created:** [July 20, 2018, 3:30pm UTC](https://discuss.elastic.co/t/indexing-suggestions-using-analyzer/140934 "2018-07-20T15:30:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dean\_Clarke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dean_clarke/32/33588_2.png) [@Dean\_Clarke](https://discuss.elastic.co/u/Dean_Clarke)\
**Post date:** [July 20, 2018, 3:30pm UTC](https://discuss.elastic.co/t/indexing-suggestions-using-analyzer/140934/1 "2018-07-20T15:30:46Z")

</div>

Good day:

I'm trying to figure out how to index suggestion without splitting my text using a delimiter and storing it in the `CompletionField`:

```
 List<string> inputs = new List<string>() {
                facility.City,
                facility.State,
                facility.ZipCode
            };
            inputs.AddRange(facility.Name.Split(' '));
            inputs.AddRange(facility.Address.Split(' '));
            inputs.AddRange(facilityType.Description.Split(' '));
            var completionField = new CompletionField()
            {
                Input = inputs.AsEnumerable<string>()
            };
            return completionField;

```

This isn't a optimal way of doing this because, I would rather let the analyzer handle this as oppose to doing this and then indexing it. Is there a way to send the entire text to Elastic and let Elastic analyze the text and store in in the completionfield on indexing or something else?

**Updated**

I've my code to index the entire text and to use the default analyzer however, this is what was index and the analyzer isn't breaking the text up

```
"suggest": {
            "input": [
              "Reston",
              "Virginia",
              "20190",
              "Facility 123456",
              "22100 Sunset Hills Rd suite 150*"
            ]
          },

```

My code:

```
 List<string> inputs = new List<string>() {
                facility.City,
                facility.State,
                facility.ZipCode
            };
            inputs.Add(facility.Name);
            inputs.Add(facility.Address);
            if (facility.Description != null && facility.Description != "")
            {
                inputs.Add(facility.Description);
            }
            var completionField = new CompletionField()
            {
                Input = inputs.AsEnumerable<string>()
            };
            return completionField;
```

---

<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:** [August 17, 2018, 3:30pm UTC](https://discuss.elastic.co/t/indexing-suggestions-using-analyzer/140934/2 "2018-08-17T15:30:59Z")

</div>

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