# Modify a rest request

**URL:** <https://discuss.elastic.co/t/modify-a-rest-request/21761>\
**Category:** Elasticsearch\
**Created:** [January 21, 2015, 7:33pm UTC](https://discuss.elastic.co/t/modify-a-rest-request/21761 "2015-01-21T19:33:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hendrik\_Dev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendrik_dev/32/978_2.png) [@Hendrik\_Dev](https://discuss.elastic.co/u/Hendrik_Dev)\
**Post date:** [January 21, 2015, 7:33pm UTC](https://discuss.elastic.co/t/modify-a-rest-request/21761/1 "2015-01-21T19:33:41Z")

</div>

Hi,

i want write a rest filter to accomplish the following:

I know that the rest request is a search request and i want to parse the  
rest requests content and modify the search query and then execute the  
modified request.

I tried a lot of things like

SearchSourceBuilder sb = RestSearchAction.parseSearchSource(request);

sb.postFilter(FilterBuilder postFilter) //-\> NPE because sb is null

I also played with ParsedQuery and QueryParser but that seems to not be the  
right for this.

Thanks

Hendrik

--  
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/219c29cb-0b2e-4df2-828d-d8d818e1a1a8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/219c29cb-0b2e-4df2-828d-d8d818e1a1a8%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, 12:37am UTC](https://discuss.elastic.co/t/modify-a-rest-request/21761/2 "2017-07-06T00:37:29Z")

</div>


