# Query with white spaces, capital letters, accents

**URL:** <https://discuss.elastic.co/t/query-with-white-spaces-capital-letters-accents/14421>\
**Category:** Elasticsearch\
**Created:** [November 14, 2013, 11:27pm UTC](https://discuss.elastic.co/t/query-with-white-spaces-capital-letters-accents/14421 "2013-11-14T23:27:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanx\_El\_Santo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sanx_el_santo/32/1990_2.png) [@Sanx\_El\_Santo](https://discuss.elastic.co/u/Sanx_El_Santo)\
**Post date:** [November 14, 2013, 11:27pm UTC](https://discuss.elastic.co/t/query-with-white-spaces-capital-letters-accents/14421/1 "2013-11-14T23:27:32Z")

</div>

Greetings to all

I need your help please

I'm testing with the following project:

curl -X DELETE localhost:9200/geonames2

curl -X PUT "[http://localhost:9200/geonames2](http://localhost:9200/geonames2)" -d '  
{  
"settings": {  
"index": {  
"analysis": {  
"analyzer": {  
"autocomplete": {  
"tokenizer": "whitespace",  
"filter": [  
"lowercase",  
"engram"  
]  
}  
},  
"filter": {  
"engram": {  
"type": "edgeNGram",  
"min\_gram": 1,  
"max\_gram": 10  
}  
}  
}  
}  
},  
"mappings": {  
"geoname": {  
"properties": {  
"name": {  
"type": "multi\_field",  
"fields": {  
"name": {  
"type": "string",  
"index": "not\_analyzed",  
"store": "yes"  
},  
"autocomplete": {  
"type": "string",  
"index\_analyzer": "autocomplete",  
"index": "analyzed",  
"search\_analyzer": "standard"  
}  
}  
},  
"location" : { "type" : "geo\_point", "store":"yes",  
"index":"analyzed" }  
}  
}  
}  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/1555414](http://localhost:9200/geonames2/geoname/1555414)" -d '  
{  
"name": "Santa Fe",  
"location" : "29.01048, -101.26557"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/1818178](http://localhost:9200/geonames2/geoname/1818178)" -d '  
{  
"name": "Wardlow",  
"location" : "32.55064, -115.33943"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/1818179](http://localhost:9200/geonames2/geoname/1818179)" -d '  
{  
"name": "Los Carapilas",  
"location" : "32.01389, -115.01611"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/1818180](http://localhost:9200/geonames2/geoname/1818180)" -d '  
{  
"name": "Aguaje del Laretto",  
"location" : "32.53306, -115.75139"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/1948754](http://localhost:9200/geonames2/geoname/1948754)" -d '  
{  
"name": "Cañada El Oro",  
"location" : "30.8973, -110.75184"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/2593121](http://localhost:9200/geonames2/geoname/2593121)" -d '  
{  
"name": "Paso Salinas",  
"location" : "18.90224, -95.94041"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3411918](http://localhost:9200/geonames2/geoname/3411918)" -d '  
{  
"name": "Chun Cedro",  
"location" : "20.1542, -89.78498"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482868](http://localhost:9200/geonames2/geoname/3482868)" -d '  
{  
"name": "Tres Marías",  
"location" : "22.48036, -98.01065"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482869](http://localhost:9200/geonames2/geoname/3482869)" -d '  
{  
"name": "Lorenzo del Real",  
"location" : "22.51667, -97.91667"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482870](http://localhost:9200/geonames2/geoname/3482870)" -d '  
{  
"name": "El Estero",  
"location" : "22.65685, -98.00748"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482871](http://localhost:9200/geonames2/geoname/3482871)" -d '  
{  
"name": "Teresa",  
"location" : "22.48804, -97.98885"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482872](http://localhost:9200/geonames2/geoname/3482872)" -d '  
{  
"name": "Benito Juárez",  
"location" : "22.49068, -98.02647"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482873](http://localhost:9200/geonames2/geoname/3482873)" -d '  
{  
"name": "Maclovio Herrera",  
"location" : "22.50076, -98.08459"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482874](http://localhost:9200/geonames2/geoname/3482874)" -d '  
{  
"name": "Estación El Esfuerzo",  
"location" : "22.48333, -98.08333"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482875](http://localhost:9200/geonames2/geoname/3482875)" -d '  
{  
"name": "Estación San Carlitos",  
"location" : "22.46667, -98.06667"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482876](http://localhost:9200/geonames2/geoname/3482876)" -d '  
{  
"name": "Cervantes",  
"location" : "22.44675, -98.05398"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482877](http://localhost:9200/geonames2/geoname/3482877)" -d '  
{  
"name": "Tres de Mayo",  
"location" : "22.40637, -98.0224"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482878](http://localhost:9200/geonames2/geoname/3482878)" -d '  
{  
"name": "La Colonia",  
"location" : "22.43748, -98.01684"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482879](http://localhost:9200/geonames2/geoname/3482879)" -d '  
{  
"name": "El Fuerte",  
"location" : "22.42649, -98.08051"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482880](http://localhost:9200/geonames2/geoname/3482880)" -d '  
{  
"name": "Laguna La Tortuga",  
"location" : "22.34481, -98.12635"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482881](http://localhost:9200/geonames2/geoname/3482881)" -d '  
{  
"name": "Mata de Labra",  
"location" : "22.44711, -98.1242"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482882](http://localhost:9200/geonames2/geoname/3482882)" -d '  
{  
"name": "Laguna la Josesito",  
"location" : "22.48762, -98.2273"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482883](http://localhost:9200/geonames2/geoname/3482883)" -d '  
{  
"name": "Vuelta de las Yeguas",  
"location" : "22.48017, -98.23893"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482884](http://localhost:9200/geonames2/geoname/3482884)" -d '  
{  
"name": "Esteros",  
"location" : "22.52031, -98.12594"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482885](http://localhost:9200/geonames2/geoname/3482885)" -d '  
{  
"name": "La Laguna",  
"location" : "22.5203, -98.18905"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482886](http://localhost:9200/geonames2/geoname/3482886)" -d '  
{  
"name": "Cuauhtémoc",  
"location" : "22.545, -98.15053"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482887](http://localhost:9200/geonames2/geoname/3482887)" -d '  
{  
"name": "Las Palmas",  
"location" : "22.5361, -98.12584"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482888](http://localhost:9200/geonames2/geoname/3482888)" -d '  
{  
"name": "Estación Los Plátanos",  
"location" : "22.6, -98.2"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482889](http://localhost:9200/geonames2/geoname/3482889)" -d '  
{  
"name": "Paso de Mora",  
"location" : "22.6346, -98.07176"  
}  
'

curl -X PUT "[http://localhost:9200/geonames2/geoname/3482890](http://localhost:9200/geonames2/geoname/3482890)" -d '  
{  
"name": "Santa Gertrudis",  
"location" : "22.62695, -98.21271"  
}  
'

And I'm testing with the following search:

curl -XGET "localhost:9200/geonames2/geoname/\_search" -d '  
{  
"query": {  
"term": {  
_"name.autocomplete": "las"_  
}  
},  
"facets": {  
"name": {  
"terms": {  
"field": "name"  
}  
}  
}  
}  
'

And everything works fine, as expected, ES returns the documents

But I need a configuration, to work with white spaces("Las Pal" ), capital  
letters ("Las") and accents("Juá"), something like this:

_"name.autocomplete": "Las"_

and this:

_"name.autocomplete": "Las Pal"_

and this:

"name.autocomplete": "Juá"

as in the following examples:

curl -XGET "localhost:9200/geonames2/geoname/\_search" -d '  
{  
"query": {  
"term": {  
"name.autocomplete": "Las Pal"  
}  
},  
"facets": {  
"name": {  
"terms": {  
"field": "name"  
}  
}  
}  
}  
'

Can someone please help me?

Thanks for your attention

--  
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:06am UTC](https://discuss.elastic.co/t/query-with-white-spaces-capital-letters-accents/14421/2 "2017-07-06T02:06:52Z")

</div>


