<commit_before># ElasticQuery

A _simple_ query builder for Elasticsearch.

+ [Example](#example)
+ [API](#api)
	- [ElasticQuery](#elasticquery-1)
	- [Filter](#filter)
	- [Query](#query)
	- [Aggregate](#aggregate)
+ [Internals](#internals)


## Example

	from elasticquery import ElasticQuery, Filter, Query, Aggregate
	
	query = ElasticQuery()
	
	# Filter
	query.must( Filter.range( 'price', 0, 500 ))
	
	# Query
	query.should( Query.nested( 'nested_key', musts=[
		Query.terms( nested_key_key=['value'] ),
		Query.prefix( another_key='prefixed_with_' )
	]))
	
	# Aggregate
	query.aggregate( 'key_terms', Aggregate.terms( 'key' ))
	
	json = query.compile()


## API

### ElasticQuery

### query.must( Query/Filter )

### query.should( Query/Filter )

### query.must_not( Query/Filter )

### query.sort( field, order )

### query.aggregate( name, Aggregate )
<commit_msg>Doc update<commit_after># ElasticQuery

A _simple_ query builder for Elasticsearch.

+ [Example](#example)
+ [API](#api)
	- [ElasticQuery](#elasticquery-1)
	- [Filter](#filter)
	- [Query](#query)
	- [Aggregate](#aggregate)
+ [Internals](#internals)


## Example

	from elasticquery import ElasticQuery, Filter, Query, Aggregate
	
	query = ElasticQuery()
	
	# Filter
	query.must( Filter.range( 'price', 0, 500 ))
	
	# Query
	query.should( Query.nested( 'nested_key', musts=[
		Query.terms( nested_key_key=['value'] ),
		Query.prefix( another_key='prefixed_with_' )
	]))
	
	# Aggregate
	query.aggregate( 'key_terms', Aggregate.terms( 'key' ))
	
	json = query.compile()


## API: ElasticQuery

### query.must( Query/Filter )

### query.should( Query/Filter )

### query.must_not( Query/Filter )

### query.sort( field, order )

### query.aggregate( name, Aggregate )

{'fraction_non_alphanumeric': 0.1729106628242075, 'fraction_numerical': 0.005763688760806916, 'mean_word_length': 4.6, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '152639', 'n_tokens_mistral': 672, 'n_tokens_neox': 607, 'n_words': 123}