# Query and static field

**URL:** <https://discuss.elastic.co/t/query-and-static-field/50345>\
**Category:** Elasticsearch\
**Created:** [May 18, 2016, 2:17pm UTC](https://discuss.elastic.co/t/query-and-static-field/50345 "2016-05-18T14:17:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlgc77](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@jlgc77](https://discuss.elastic.co/u/jlgc77)\
**Post date:** [May 18, 2016, 2:17pm UTC](https://discuss.elastic.co/t/query-and-static-field/50345/1 "2016-05-18T14:17:01Z")

</div>

I have a code that when a value reaches the value my REST "query" looks me in the fields of my entity "Terreno0101" and does right

@RestController  
////  
Page page = terreno0101Service.search(requestParams.get("query"), pageable);  
////

@Service  
@Transactional  
////////  
@Transactional(readOnly = true)  
public Page search(String query, Pageable pageable) {  
log.debug("Request to search for a page of Terreno0101S for query {}", query);  
return terreno0101SearchRepository.search(queryStringQuery(query), pageable);  
}  
////

Now I need to add that besides that, is satisfied that the field "entorno" is equal to one field I him  
return terreno0101SearchRepository.search(queryStringQuery(query///example:and entorno=1010///), pageable);

I need you to look all you have to query the value in any field (that's what there is right now) but also that the "entorno" field is equal to I directed.

---

<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:50pm UTC](https://discuss.elastic.co/t/query-and-static-field/50345/2 "2017-07-05T22:50:36Z")

</div>

Closed on July 5, 2017, 10:50pm UTC


