# Comparing Large Text Documents -- Queries with Large Text Fields

**URL:** https://discuss.elastic.co/t/comparing-large-text-documents-queries-with-large-text-fields/13773
**Category:** Elasticsearch
**Created:** [September 26, 2013, 8:08pm UTC](https://discuss.elastic.co/t/comparing-large-text-documents-queries-with-large-text-fields/13773 "2013-09-26T20:08:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Shawn\_O\_Banion](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Shawn\_O\_Banion](https://discuss.elastic.co/u/Shawn_O_Banion)
#### Post date: [September 26, 2013, 8:08pm UTC](https://discuss.elastic.co/t/comparing-large-text-documents-queries-with-large-text-fields/13773/1 "2013-09-26T20:08:45Z")

</div>

Hello,

I'm interested in using ElasticSearch to compare large text documents. So,  
essentially, I want to index documents that contain a large-ish 'text'  
field (on average, 25,000+ characters or 3,500 words). I then want to  
search this index using a query parameter on this same field with a value  
of a similar size.

Is this an appropriate use-case for ElasticSearch? If so, what type of  
query (e.g. match, query\_string) would you recommend using? At first  
glance, a match query seems best since it won't "parse" the query string.

Just playing around, I tried the match query (with the default "or"  
operator) and received this error:

pyes.exceptions.ElasticSearchException: TooManyClauses[maxClauseCount is  
set to 1024];

Is it simply a matter of increasing the maxClauseCount to support my  
requirements?

Thanks for your help!  
Shawn

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)
#### Post date: [September 30, 2013, 9:57pm UTC](https://discuss.elastic.co/t/comparing-large-text-documents-queries-with-large-text-fields/13773/2 "2013-09-30T21:57:10Z")

</div>

Hi Shawn,

If you are OK with such queries not being fast and not being cheap, you can  
up the limits and this should be OK.

[http://search-lucene.com/?q="maxClauseCount"&fc\_project=ElasticSearch&fc\_type=mail+\_hash\_+user](http://search-lucene.com/?q=%22maxClauseCount%22&fc_project=ElasticSearch&fc_type=mail+_hash_+user)

## Otis

Solr & Elasticsearch Support -- [http://sematext.com/](http://sematext.com/)  
Performance Monitoring -- [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm)

On Thursday, September 26, 2013 4:08:45 PM UTC-4, Shawn O'Banion wrote:

> Hello,
> 
> I'm interested in using Elasticsearch to compare large text documents. So,  
> essentially, I want to index documents that contain a large-ish 'text'  
> field (on average, 25,000+ characters or 3,500 words). I then want to  
> search this index using a query parameter on this same field with a value  
> of a similar size.
> 
> Is this an appropriate use-case for Elasticsearch? If so, what type of  
> query (e.g. match, query\_string) would you recommend using? At first  
> glance, a match query seems best since it won't "parse" the query string.
> 
> Just playing around, I tried the match query (with the default "or"  
> operator) and received this error:
> 
> pyes.exceptions.ElasticSearchException: TooManyClauses[maxClauseCount is  
> set to 1024];
> 
> Is it simply a matter of increasing the maxClauseCount to support my  
> requirements?
> 
> Thanks for your help!  
> Shawn

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:14am UTC](https://discuss.elastic.co/t/comparing-large-text-documents-queries-with-large-text-fields/13773/3 "2017-07-06T02:14:12Z")

</div>


