# Using a fuzzy query in a custom score with a geo filter

**URL:** https://discuss.elastic.co/t/using-a-fuzzy-query-in-a-custom-score-with-a-geo-filter/9235
**Category:** Elasticsearch
**Created:** [October 3, 2012, 8:41pm UTC](https://discuss.elastic.co/t/using-a-fuzzy-query-in-a-custom-score-with-a-geo-filter/9235 "2012-10-03T20:41:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pr2012](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pr2012/32/2186_2.png) [@pr2012](https://discuss.elastic.co/u/pr2012)
#### Post date: [October 3, 2012, 8:41pm UTC](https://discuss.elastic.co/t/using-a-fuzzy-query-in-a-custom-score-with-a-geo-filter/9235/1 "2012-10-03T20:41:34Z")

</div>

Hi all. Running into an issue with what is for me a complex query.

I attempting to do the following: Adjust the score of a geo filtered query  
based on distance and include a distance via script field. Gist of my query  
here: [https://gist.github.com/3829655](https://gist.github.com/3829655)

When I use a fuzzy query next to the geo filter I get an exception. If I  
just do a bool, its fine.

So this works:  
query  
custom\_score  
query  
filtered  
query:{"match\_all":{}}  
filter  
params  
script  
script\_fields

This does not:

query  
custom\_score  
query  
filtered  
query:{"fuzzy":{name:{value:'pizza'}}}  
filter  
params  
script  
script\_fields

How should I be structuring this query differently to allow fuzzy?

thx!

--

---

<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, 3:10am UTC](https://discuss.elastic.co/t/using-a-fuzzy-query-in-a-custom-score-with-a-geo-filter/9235/2 "2017-07-06T03:10:17Z")

</div>


