# Excluding fields with partial fields not working?

**URL:** <https://discuss.elastic.co/t/excluding-fields-with-partial-fields-not-working/13222>\
**Category:** Elasticsearch\
**Created:** [August 15, 2013, 1:50am UTC](https://discuss.elastic.co/t/excluding-fields-with-partial-fields-not-working/13222 "2013-08-15T01:50:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![concept47](https://avatars.discourse-cdn.com/v4/letter/c/f6c823/32.png) [@concept47](https://discuss.elastic.co/u/concept47)\
**Post date:** [August 15, 2013, 1:50am UTC](https://discuss.elastic.co/t/excluding-fields-with-partial-fields-not-working/13222/1 "2013-08-15T01:50:40Z")

</div>

I'm trying to use the fields setting[http://www.elasticsearch.org/guide/reference/api/search/fields/](http://www.elasticsearch.org/guide/reference/api/search/fields/)to exclude a particular field from search queries, specifically using  
partial fields.  
All my fields are loaded from source and I'm using this (ruby hash) as the  
representation of what I want to exclude

```
  {
    :query => {
      :query_string => {
        :query => @query,
        :default_operator => "AND"
      }
    },
    :partial_fields => {
      :partial1 => {
        :exclude => 'post.document_body'
      }
    }
  }

```

but that field still keeps getting returned in search results.  
Any suggestions about what I'm doing wrong?

--  
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:** ![Tzvi\_Gregory\_Kaidano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tzvi_gregory_kaidano/32/1302_2.png) [@Tzvi\_Gregory\_Kaidano](https://discuss.elastic.co/u/Tzvi_Gregory_Kaidano)\
**Post date:** [September 3, 2014, 5:01am UTC](https://discuss.elastic.co/t/excluding-fields-with-partial-fields-not-working/13222/2 "2014-09-03T05:01:58Z")

</div>

got it solved?

On Thursday, August 15, 2013 4:50:40 AM UTC+3, concept47 wrote:

> I'm trying to use the fields setting  
> [http://www.elasticsearch.org/guide/reference/api/search/fields/](http://www.elasticsearch.org/guide/reference/api/search/fields/) to  
> exclude a particular field from search queries, specifically using partial  
> fields.  
> All my fields are loaded from source and I'm using this (ruby hash) as the  
> representation of what I want to exclude
> 
> ```
> {
> :query => {
> :query_string => {
> :query => @query,
> :default_operator => "AND"
> }
> },
> :partial_fields => {
> :partial1 => {
> :exclude => 'post.document_body'
> }
> }
> }
> 
> ```
> 
> but that field still keeps getting returned in search results.  
> Any suggestions about what I'm doing wrong?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a16eea08-8e22-4d59-b6e7-ad87ce2f4626%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a16eea08-8e22-4d59-b6e7-ad87ce2f4626%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:04am UTC](https://discuss.elastic.co/t/excluding-fields-with-partial-fields-not-working/13222/3 "2017-07-06T01:04:46Z")

</div>


