# Java DSL query DSL different results

**URL:** <https://discuss.elastic.co/t/java-dsl-query-dsl-different-results/11005>\
**Category:** Elasticsearch\
**Created:** [March 4, 2013, 9:08pm UTC](https://discuss.elastic.co/t/java-dsl-query-dsl-different-results/11005 "2013-03-04T21:08:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric\_sanford](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@eric\_sanford](https://discuss.elastic.co/u/eric_sanford)\
**Post date:** [March 4, 2013, 9:08pm UTC](https://discuss.elastic.co/t/java-dsl-query-dsl-different-results/11005/1 "2013-03-04T21:08:56Z")

</div>

when i run this query, i correctly get only the NUM\_OF\_WKS field back

{"filter":{"exists":{"field":"NUM\_OF\_WKS"}}, _"fields" : ["NUM\_OF\_WKS"],_"facets" :  
{"Number\_of\_Weeks\_Facet":{"terms":{"field":"NUM\_OF\_WKS","size":"1"} }}}

but when i run the same query thru a java search, i get NULL for that field

final SearchResponse response = client  
.search(new SearchRequest("scnprobldir3a")  
.types("dimItem")  
.source("{"filter":{"exists":{"field":"NUM\_OF\_WKS"}}, \* "fields"  
: ["NUM\_OF\_WKS"],\* "facets" :  
{"Number\_of\_Weeks\_Facet":{"terms":{"field":"NUM\_OF\_WKS","size":"100"}  
}}}"))  
.actionGet();

Can anyone help???

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:48am UTC](https://discuss.elastic.co/t/java-dsl-query-dsl-different-results/11005/2 "2017-07-06T02:48:27Z")

</div>


