# Using tokenizer on rank\_feature fields

**URL:** <https://discuss.elastic.co/t/using-tokenizer-on-rank-feature-fields/240417>\
**Category:** Elasticsearch\
**Created:** [July 8, 2020, 6:00pm UTC](https://discuss.elastic.co/t/using-tokenizer-on-rank-feature-fields/240417 "2020-07-08T18:00:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukegil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukegil/32/71830_2.png) [@lukegil](https://discuss.elastic.co/u/lukegil)\
**Post date:** [July 8, 2020, 6:00pm UTC](https://discuss.elastic.co/t/using-tokenizer-on-rank-feature-fields/240417/1 "2020-07-08T18:00:03Z")

</div>

Hi! I was wondering if it's possible to apply tokenizer/analyzers to [rank\_feature](https://www.elastic.co/guide/en/elasticsearch/reference/current/rank-feature.html) fields. When attempting to create a sample index on ES 7.6.2 it doesn't appear to work, but I don't see anything explicit in the docs.

Index creation:

```auto
    curl -X PUT \
      http://127.0.0.1:9500/test/ \
      -H 'Cache-Control: no-cache' \
      -H 'Content-Type: application/json' \
      -H 'cache-control: no-cache' \
      -d '{
        "mappings": {
            "properties": {
                "topics": {
                    "type": "rank_features",
                    "analyzer": "path_analyzers"
                }
            }
        },
        "settings": {
            "analysis": {
                "analyzer": {
                    "path_analyzer": {
                        "tokenizer": "path_hierarchy"
                    }
                }
            }
        }
    }'

```

Response:

```auto
    {
        "error": {
            "root_cause": [
                {
                    "type": "mapper_parsing_exception",
                    "reason": "Mapping definition for [topics] has unsupported parameters: [analyzer : path_analyzers]"
                }
            ],
            "type": "mapper_parsing_exception",
            "reason": "Failed to parse mapping [_doc]: Mapping definition for [topics] has unsupported parameters: [analyzer : path_analyzers]",
            "caused_by": {
                "type": "mapper_parsing_exception",
                "reason": "Mapping definition for [topics] has unsupported parameters: [analyzer : path_analyzers]"
            }
        },
        "status": 400
    }

```

Version info:

```auto
    > elasticsearch -version
    Version: 7.6.2-SNAPSHOT
    Build: oss/tar/unknown/2020-06-09T10:44:47.280460Z
    JVM: 14.0.1

    > java -version
    openjdk version "1.8.0_222"
    OpenJDK Runtime Environment Corretto-8.222.10.1 (build 1.8.0_222-b10)
    OpenJDK 64-Bit Server VM Corretto-8.222.10.1 (build 25.222-b10, mixed mode)

    # OS 
    > sw_vers
    ProductName: Mac OS X
    ProductVersion: 10.14.4
    BuildVersion: 18E226

```

---

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [July 9, 2020, 10:45am UTC](https://discuss.elastic.co/t/using-tokenizer-on-rank-feature-fields/240417/2 "2020-07-09T10:45:57Z")

</div>

No, it is not possible to use `analyzer` or `normalizer` for `rank_features` data types.  
This field assumes that its features already come as analyzed/normalized terms. It then will index these terms into a rank\_features field (in our case, it is "topics") with provided frequencies.

---

<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 6, 2020, 10:46am UTC](https://discuss.elastic.co/t/using-tokenizer-on-rank-feature-fields/240417/3 "2020-08-06T10:46:04Z")

</div>

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