# Emoji unicode characters and term vector offsets in elasticsearch-py in Python 3.4

**URL:** <https://discuss.elastic.co/t/emoji-unicode-characters-and-term-vector-offsets-in-elasticsearch-py-in-python-3-4/29967>\
**Category:** Elasticsearch\
**Created:** [September 25, 2015, 7:27am UTC](https://discuss.elastic.co/t/emoji-unicode-characters-and-term-vector-offsets-in-elasticsearch-py-in-python-3-4/29967 "2015-09-25T07:27:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Lam](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@Patrick\_Lam](https://discuss.elastic.co/u/Patrick_Lam)\
**Post date:** [September 25, 2015, 7:27am UTC](https://discuss.elastic.co/t/emoji-unicode-characters-and-term-vector-offsets-in-elasticsearch-py-in-python-3-4/29967/1 "2015-09-25T07:27:07Z")

</div>

Hi,

I'm using Python 3.4 with the elasticsearch-py client. When my text fields include emojis, they seem to screw up the term vector offsets. My understanding is that this has something to do with how certain python clients encode unicode characters.

For example,

```
>> es.indices.analyze(body='\U0001f64f testing')
{'tokens': [{'end_offset': 10,
   'position': 1,
   'start_offset': 3,
   'token': 'testing',
   'type': '<ALPHANUM>'}]}

>> '\U0001f64f testing'[3:10]
'esting'

```

I get this error in Python 3.4 and Python 2.7.9, but not 2.7.10. Is there a way to get around this in Python 3.4? I want to be able to match the start and stop offsets from the retrieved term vectors to the position indexing in Python.

---

<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 5, 2017, 11:48pm UTC](https://discuss.elastic.co/t/emoji-unicode-characters-and-term-vector-offsets-in-elasticsearch-py-in-python-3-4/29967/2 "2017-07-05T23:48:06Z")

</div>

Closed on July 5, 2017, 11:48pm UTC


