# How to add token\_chars: symbol using linq notation?

**URL:** <https://discuss.elastic.co/t/how-to-add-token-chars-symbol-using-linq-notation/319736>\
**Category:** Elasticsearch\
**Created:** [November 24, 2022, 10:28am UTC](https://discuss.elastic.co/t/how-to-add-token-chars-symbol-using-linq-notation/319736 "2022-11-24T10:28:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frankmehlhop.com](https://avatars.discourse-cdn.com/v4/letter/f/97f17d/32.png) [@frankmehlhop.com](https://discuss.elastic.co/u/frankmehlhop.com)\
**Post date:** [November 24, 2022, 10:28am UTC](https://discuss.elastic.co/t/how-to-add-token-chars-symbol-using-linq-notation/319736/1 "2022-11-24T10:28:34Z")

</div>

I want that I can also search for symbols like "§123".  
I find that I should add token\_chars: symbol.  
([example](https://discuss.elastic.co/t/new-elasticsearch-java-api-createindexrequest-using-withjson-causes-co-elastic-clients-util-missingrequiredpropertyexception/308303))

```auto
"token_chars": ["letter", "digit", "punctuation", "symbol"]

```

At my C#-code I'm using elasticClient.Indices.Create() and linq syntax.  
**How can I implement token\_chars: symbol at my setting?**

```auto
CreateIndexResponse createIndexResponse = elasticClient.Indices.Create(sep.DefaultIndex, c => c
    .Settings(s => s
        .Analysis(a => a
            .Analyzers(ad => ad
                .Custom("windows_path_hierarchy_analyzer", ca => ca
                    .Tokenizer("windows_path_hierarchy_tokenizer")
                )
            )
            .Tokenizers(t => t
                .PathHierarchy("windows_path_hierarchy_tokenizer", ph => ph
                    .Delimiter('\\')
                )
            )
        )
    )
    .Map<ElasticDocument>(mp => mp
        .AutoMap()
        .Properties(ps => ps
            .Text(s => s
                .Name(n => n.Path)
                .Analyzer("windows_path_hierarchy_analyzer")
            )
            .Object<Attachment>(a => a
                .Name(n => n.Attachment)
                .AutoMap()
            )
        )
    )
);

```

---

<div class="post-metadata">

**Author:** ![frankmehlhop.com](https://avatars.discourse-cdn.com/v4/letter/f/97f17d/32.png) [@frankmehlhop.com](https://discuss.elastic.co/u/frankmehlhop.com)\
**Post date:** [November 24, 2022, 1:30pm UTC](https://discuss.elastic.co/t/how-to-add-token-chars-symbol-using-linq-notation/319736/2 "2022-11-24T13:30:08Z")

</div>

I find the solution technically.  
But still "§" is not found.

```auto
.Tokenizers(t => t
    .PathHierarchy("windows_path_hierarchy_tokenizer", ph => ph
        .Delimiter('\\')
    )
    .NGram("ngram_tokenizer", td => td
    .MinGram(2)
    .MaxGram(20)
    .TokenChars(
        TokenChar.Letter,
        TokenChar.Digit,
        TokenChar.Symbol)
)
)

```

---

<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:** [December 22, 2022, 1:30pm UTC](https://discuss.elastic.co/t/how-to-add-token-chars-symbol-using-linq-notation/319736/3 "2022-12-22T13:30:56Z")

</div>

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