# Search term with default field

**URL:** https://discuss.elastic.co/t/search-term-with-default-field/231790
**Category:** Elasticsearch
**Created:** [May 8, 2020, 7:49pm UTC](https://discuss.elastic.co/t/search-term-with-default-field/231790 "2020-05-08T19:49:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Attila816](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/attila816/32/68007_2.png) [@Attila816](https://discuss.elastic.co/u/Attila816)
#### Post date: [May 8, 2020, 7:49pm UTC](https://discuss.elastic.co/t/search-term-with-default-field/231790/1 "2020-05-08T19:49:34Z")

</div>

Hi, I would like to set a default field for my index, so that when I would like to search for a term I don't need to specify the field in which  
I don't know how can I specify programmatically the "default field" to search for. In my queries I write `content:House` and it searches in the field `content`. But how can I specify this programmatically that `content` is my default field and a user only has to enter `House` (and lucene then automatically searches in the "content" field).

---

<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: [June 5, 2020, 7:49pm UTC](https://discuss.elastic.co/t/search-term-with-default-field/231790/2 "2020-06-05T19:49:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
