# Queries with large character counts in fields

**URL:** <https://discuss.elastic.co/t/queries-with-large-character-counts-in-fields/192457>\
**Category:** Elasticsearch\
**Created:** [July 26, 2019, 2:04pm UTC](https://discuss.elastic.co/t/queries-with-large-character-counts-in-fields/192457 "2019-07-26T14:04:26Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [July 26, 2019, 9:58pm UTC](https://discuss.elastic.co/t/queries-with-large-character-counts-in-fields/192457/4 "2019-07-26T21:58:22Z")

</div>

Thanks Jason! I believe the highlighter is the culprit here. Using highlighter with large fields will always incur performance considerations because it has to load the entire text, analyze it, and search it.

Here's a thread from a user with a similar problem as yours: [Highlighting takes long time for large documents](https://discuss.elastic.co/t/highlighting-takes-long-time-for-large-documents/8448).

Here are some solutions to consider:

- Set `index_options` to `offsets` in the mapping. You'll have to reindex your data to try this solution. This will allow the default `unified` highlighter to skip the analysis step. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html#offsets-strategy](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html#offsets-strategy) for more info.
- Set `term_vector` to `with_position_offsets` in the mapping. This also requires reindexing. It will also increase the size of the index significantly. See the above links for more info on this option.
- Use the fast vector highlighter by setting your highlighter `type` to `fvh`. Use this option in conjunction with the `term_vector` option. Comes with the same tradeoff. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html#fast-vector-highlighter](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html#fast-vector-highlighter).

---

_[View the full topic](https://discuss.elastic.co/t/queries-with-large-character-counts-in-fields/192457)._
