# How to filter for only documents that have a specific field

**URL:** <https://discuss.elastic.co/t/how-to-filter-for-only-documents-that-have-a-specific-field/204134>\
**Category:** Elasticsearch\
**Created:** [October 17, 2019, 9:59pm UTC](https://discuss.elastic.co/t/how-to-filter-for-only-documents-that-have-a-specific-field/204134 "2019-10-17T21:59:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clang/32/56137_2.png) [@Clang](https://discuss.elastic.co/u/Clang)\
**Post date:** [October 17, 2019, 9:59pm UTC](https://discuss.elastic.co/t/how-to-filter-for-only-documents-that-have-a-specific-field/204134/1 "2019-10-17T21:59:11Z")

</div>

Only some of our pages have a certain field associated with them. Let's call that field `translated_ja` and the value would be a URL string. I want to provide a filter on the form that ultimately calls the swiftype search.json API endpoint. I don't see a way to filter results via the JSON to only return results where that field exists in the document.

Is this supported? Anyone have any clever workarounds? I know I could apply some javascript after the call, but ideally I would just do this via the call. Looks like

---

<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:** [November 14, 2019, 9:59pm UTC](https://discuss.elastic.co/t/how-to-filter-for-only-documents-that-have-a-specific-field/204134/2 "2019-11-14T21:59:16Z")

</div>

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