The `elasticsearch-ruby` library is what we call a "low level" client, 
closely matching the semantics and notation of the REST API.

So, you pass in exactly the same query as you would into Curl. The only 
exception here are e.g. names of document types, which are part of the URL, 
and are correctly escaped for you.

Finally, as Jason notes below, no library can "intelligently escape" 
special characters for you, because sometimes, `~` is a `~` and sometimes 
it's a proximity search expression...

Have a look at 
the 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html
 
which might provide a better syntax, and generally avoid the `query_string` 
query for user facing searches, unless warranted by a special use case 
(librarians, researchers, etc).

Karel



On Friday, January 10, 2014 1:34:31 AM UTC+1, Srirang Doddihal wrote:
>
> Hi,
>
> I tried out the elasticsearch Ruby gem today and found that it does not 
> escape the reserve characters when searching with the query_string query.
>
> As a library providing easy to use search API, wouldn't it be better if 
> the library escaped the reserve characters in this case? 
> The API can support a flag,  with a sensible default value, to enable or 
> disable this escaping behavior.
>
> Or is it an explicit design decision that the users themselves have to 
> escape the reserve characters before sending it to this library?
>
> I am using v0.4.5.
>
> Regards,
> Brahmana
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/85308030-d0bb-4982-bb32-7424ba0068fe%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to