# Spring StringQuery not working while actual query directly works on postman

**URL:** <https://discuss.elastic.co/t/spring-stringquery-not-working-while-actual-query-directly-works-on-postman/255882>\
**Category:** Elasticsearch\
**Created:** [November 18, 2020, 6:24pm UTC](https://discuss.elastic.co/t/spring-stringquery-not-working-while-actual-query-directly-works-on-postman/255882 "2020-11-18T18:24:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![satyarajp](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@satyarajp](https://discuss.elastic.co/u/satyarajp)\
**Post date:** [November 18, 2020, 6:24pm UTC](https://discuss.elastic.co/t/spring-stringquery-not-working-while-actual-query-directly-works-on-postman/255882/1 "2020-11-18T18:24:55Z")

</div>

I'm migrating our native to springboot+java and am stuck here with this search.  
Didn't find much examples around web also.

> { "query": output in log below}

I'm getting output in postman. Yet the actual java code returns empty.

```
StringQuery query = new StringQuery(jsonInput);
log.info (query.getSource);
//prints this in log // 

```

> ```
> {
> 
> "term": {
> "title": {
> "boost": 1.0,
> "value": "kat"
> }
> }
>     
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![satyarajp](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@satyarajp](https://discuss.elastic.co/u/satyarajp)\
**Post date:** [November 19, 2020, 10:09am UTC](https://discuss.elastic.co/t/spring-stringquery-not-working-while-actual-query-directly-works-on-postman/255882/2 "2020-11-19T10:09:55Z")

</div>

I've been trying out with simple queries to understand behaviour.  
Updated actual post with recent simple query , please help!

1. I think i should post this mostly in springdata group.
2. Can someone help me find right logs to understand what query ES7.6.2 is receiving when actual search operation happens through postman and my code.  
I'm assuming a comparison should help me understand.

---

<div class="post-metadata">

**Author:** ![satyarajp](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@satyarajp](https://discuss.elastic.co/u/satyarajp)\
**Post date:** [November 19, 2020, 12:07pm UTC](https://discuss.elastic.co/t/spring-stringquery-not-working-while-actual-query-directly-works-on-postman/255882/3 "2020-11-19T12:07:19Z")

</div>

Guys, Forgive me for my bad programming habits.

`return null;`

I would blame myself for few sleepless nights. 😪

---

<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:** [December 17, 2020, 12:07pm UTC](https://discuss.elastic.co/t/spring-stringquery-not-working-while-actual-query-directly-works-on-postman/255882/4 "2020-12-17T12:07:26Z")

</div>

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