# Term problem

**URL:** <https://discuss.elastic.co/t/term-problem/8489>\
**Category:** Elasticsearch\
**Created:** [July 23, 2012, 2:32pm UTC](https://discuss.elastic.co/t/term-problem/8489 "2012-07-23T14:32:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kunolek](https://avatars.discourse-cdn.com/v4/letter/k/8baadc/32.png) [@kunolek](https://discuss.elastic.co/u/kunolek)\
**Post date:** [July 23, 2012, 2:32pm UTC](https://discuss.elastic.co/t/term-problem/8489/1 "2012-07-23T14:32:55Z")

</div>

> **[Elasticsearch weird search result?](https://answers.yahoo.com/question/index;_ylt=Ajjy7LeG.eUccXDLmlE9nansy6IX;_ylv=3?qid=20120720043427AA4fUtd)**
>
> I have a problem with understanding of ElasticSearch.
> 
> Here's my example:
> 
> for query:
> 
> curl -XPOST 'http://localhost:9200/\_search' -d '
> {
> "query": {
> "term": {
> ...

Elasticsearch weird search result?  
I have a problem with understanding of ElasticSearch.

Here's my example:

for query:

curl -XPOST '[http://localhost:9200/\_search](http://localhost:9200/_search)' -d '  
{  
"query": {  
"term": {  
"main\_place": "katowice"  
}  
}  
}'

i have 0 results, but i have documents with main\_place = katowice  
i have a clue:

curl -XPOST '[http://localhost:9200/\_search](http://localhost:9200/_search)' -d '  
{  
"query": {  
"term": {  
"main\_place": "katowic"  
}  
}  
}'

it gives me results with main\_place = katowice and one document with main\_place = katowic  
i see that problem is with katowic is prefix of katowice

there is no problem with query:

curl -XPOST '[http://localhost:9200/\_search](http://localhost:9200/_search)' -d '  
{  
"query": {  
"term": {  
"main\_place": "warszawa"  
}  
}  
}'

i get good results, but there is no "warszaw" in main\_places.

I'm waiting for solutions, i know that "text" instead for "term" works, but not with "custom\_filter\_score" filters.

---

<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:19am UTC](https://discuss.elastic.co/t/term-problem/8489/2 "2017-07-06T03:19:26Z")

</div>

Closed on July 6, 2017, 3:19am UTC


