# Santizing query-strings

**URL:** <https://discuss.elastic.co/t/santizing-query-strings/15917>\
**Category:** Elasticsearch\
**Created:** [February 20, 2014, 7:25am UTC](https://discuss.elastic.co/t/santizing-query-strings/15917 "2014-02-20T07:25:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malte\_Schirmacher](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Malte\_Schirmacher](https://discuss.elastic.co/u/Malte_Schirmacher)\
**Post date:** [February 20, 2014, 7:25am UTC](https://discuss.elastic.co/t/santizing-query-strings/15917/1 "2014-02-20T07:25:11Z")

</div>

Hello Elasticsearch-users,

are there best practices for sanitizing query strings?

What i want to do is  
a) dont let users issue expensive queries  
b) hinder _some_ users from searching specific fields  
c) internationalize field names.

OK, c) isn't really sanitizing, but i think all 3 points would require a  
pre parsing process, so i thought i also mention this 🙂  
Is there a way to do this? And if not, why are we the only ones with this  
requirements?

Thanks in advance  
thana

--  
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/a8c3a89f-6c54-40b0-a4d9-10966e848d7e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a8c3a89f-6c54-40b0-a4d9-10966e848d7e%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [February 20, 2014, 2:53pm UTC](https://discuss.elastic.co/t/santizing-query-strings/15917/2 "2014-02-20T14:53:53Z")

</div>

Your best bet is probably a custom parser with your own grammar. On the ES  
side, if you use something like a simple\_query\_string or a match query, it  
would also help a little bit (instead of using the query\_string query).

--  
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/47cc8395-9802-4443-bdd7-a98a74b43961%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/47cc8395-9802-4443-bdd7-a98a74b43961%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Malte\_Schirmacher](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Malte\_Schirmacher](https://discuss.elastic.co/u/Malte_Schirmacher)\
**Post date:** [February 21, 2014, 9:28am UTC](https://discuss.elastic.co/t/santizing-query-strings/15917/3 "2014-02-21T09:28:14Z")

</div>

Thanks for your answer 🙂  
How would i do that?

--  
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/389ccbc7-6d09-4ad6-b552-c5b3e4586a7b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/389ccbc7-6d09-4ad6-b552-c5b3e4586a7b%40googlegroups.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, 1:48am UTC](https://discuss.elastic.co/t/santizing-query-strings/15917/4 "2017-07-06T01:48:28Z")

</div>


