# Term doesn't work on all fileds?

**URL:** https://discuss.elastic.co/t/term-doesnt-work-on-all-fileds/4221
**Category:** Elasticsearch
**Created:** [April 12, 2011, 1:18pm UTC](https://discuss.elastic.co/t/term-doesnt-work-on-all-fileds/4221 "2011-04-12T13:18:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vodnok](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vodnok/32/3248_2.png) [@vodnok](https://discuss.elastic.co/u/vodnok)
#### Post date: [April 12, 2011, 1:18pm UTC](https://discuss.elastic.co/t/term-doesnt-work-on-all-fileds/4221/1 "2011-04-12T13:18:05Z")

</div>

Hi,

New in elastic... (2-3 days testing)

I indexed some documents and here are the mapping :

{  
"kumo" : {  
"obj" : {  
"properties" : {  
"DT\_CREATED" : {  
"type" : "string"  
},  
"DT\_SORT\_1" : {  
"type" : "string"  
},  
"C\_OBJ\_TYPE" : {  
"type" : "string"  
},  
"query" : {  
"dynamic" : "true",  
"properties" : {  
"term" : {  
"dynamic" : "true",  
"properties" : {  
"L\_INDEX\_1" : {  
"type" : "string"  
}  
}  
}  
}  
},  
"L\_INDEX\_BIS\_1" : {  
"type" : "string"  
},  
"DT\_INDEXED" : {  
"type" : "string"  
},  
"ID\_INDEX\_OBJECT" : {  
"type" : "string"  
},  
"L\_INDEX\_3" : {  
"type" : "string"  
},  
"ID\_INDEX\_OBJECT\_DB" : {  
"type" : "string"  
},  
"L\_INDEX\_2" : {  
"type" : "string"  
},  
"L\_INDEX\_1" : {  
"type" : "string"  
}  
}  
}  
}  
}

Testing the query... i want to use "term" but it only works on L\_INDEX\_1. "term" on other fields return no result. When i see the mapping it seems logic because there is only :

"query" : {  
"dynamic" : "true",  
"properties" : {  
"term" : {  
"dynamic" : "true",  
"properties" : {  
"L\_INDEX\_1" : {  
"type" : "string"  
}  
}  
}  
}  
},

I didn't touch anything to the mapping, only indexing... I believed that it was automatic. So why i cannot use term on other field.

I use query\_string too... here are my query json :

{  
"query": {  
"bool": {  
"must" : {  
"query\_string" : {  
"query" : "13160",  
"fields" : [  
"ID\_INDEX\_OBJECT\_DB^1000",  
"L\_INDEX\_1^100",  
"L\_INDEX\_2^10",  
"L\_INDEX\_3^1"  
]  
}  
},  
"must" : {  
"term" : {  
"C\_OBJ\_TYPE": "ISO\_LOC"  
}  
}  
}  
}  
}

I think it's related to :"Term Query - Matches documents that have fields that contain a a term (not analyzed). " But how to control this ?

Thank you,

Vodnok

---

<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, 4:08am UTC](https://discuss.elastic.co/t/term-doesnt-work-on-all-fileds/4221/2 "2017-07-06T04:08:28Z")

</div>


