# How to do partial matching on decimal numbers in a text field?

**URL:** <https://discuss.elastic.co/t/how-to-do-partial-matching-on-decimal-numbers-in-a-text-field/60668>\
**Category:** Elasticsearch\
**Created:** [September 16, 2016, 5:13am UTC](https://discuss.elastic.co/t/how-to-do-partial-matching-on-decimal-numbers-in-a-text-field/60668 "2016-09-16T05:13:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoeCrocker](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@JoeCrocker](https://discuss.elastic.co/u/JoeCrocker)\
**Post date:** [September 16, 2016, 5:13am UTC](https://discuss.elastic.co/t/how-to-do-partial-matching-on-decimal-numbers-in-a-text-field/60668/1 "2016-09-16T05:13:55Z")

</div>

Does anyone know how to perform partial matching on a decimal number in string? How should my index and mappings be configured to accomplish this?

Using example data below, I would like to see the results for the following queries:  
Query: "query": "1"  
Search Results:  
We are looking for C++ and C# developers 1.6  
We are looking for C developers 1  
We are looking for project managers 1.1

Query: "query": "1."  
Search Results:  
We are looking for C++ and C# developers 1.6  
We are looking for project managers 1.1

Query: "query": ".1"  
Search Results:  
We are looking for project managers 1.1

----------------------- Example ---------------  
PUT /my\_index3  
{  
"settings": {  
"analysis": {  
"analyzer": {  
"my\_analyzer": {  
"type": "custom",  
"filter": [  
"lowercase"  
],  
"tokenizer": "standard"  
}  
}  
}  
}  
}

PUT /my\_index3/\_mapping/jobs  
{  
"properties": {  
"content": {  
"type": "string",  
"analyzer": "my\_analyzer"  
}  
}  
}

POST /\_bulk  
{"index":{"\_index":"my\_index3","\_type":"jobs"}}  
{"content":"We are looking for C++ and C# developers 1.6"}  
{"index":{"\_index":"my\_index3","\_type":"jobs"}}  
{"content":"We are looking for C developers 1"}  
{"index":{"\_index":"my\_index3","\_type":"jobs"}}  
{"content":"We are looking for project managers 4.5"}  
{"index":{"\_index":"my\_index3","\_type":"jobs"}}  
{"content":"We are looking for project managers 16.2"}  
{"index":{"\_index":"my\_index3","\_type":"jobs"}}  
{"content":"We are looking for project managers 6"}  
{"index":{"\_index":"my\_index3","\_type":"jobs"}}  
{"content":"We are looking for project managers 1.1"}  
{"index":{"\_index":"my\_index3","\_type":"jobs"}}  
{"content":"We are looking for project managers fu boo"}

GET /my\_index3/jobs/\_search  
{  
"query": {  
"match": {  
"content": {  
"query": "1"  
}  
}  
}  
}

---

<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 5, 2017, 10:19pm UTC](https://discuss.elastic.co/t/how-to-do-partial-matching-on-decimal-numbers-in-a-text-field/60668/2 "2017-07-05T22:19:50Z")

</div>


