Parentheses in http querystring help needed

Dear list,

We are running EC on top of a Mongo DB and it works great. An iPhone client
queries EC through http calls.

I would like to be able to have the search term include parentheses and a
colon, I have tried to escape and encode the parentheses as per the Lucene
docs (see sample query string below), but it does not seem to work
properly, is there anybody out there who knows how to do this?

?q=rechtsgebied_rechtspraak:%22Belasting%22+%22%5C%28hierna%5C:%20de%20Wet%5C%29%22&default_operator=AND&sort=datum_gepubliceerd_ymd:desc&size=20&from=0

This part is what this request is
about: %22%5C%28hierna%5C:%20de%20Wet%5C%29%22

Unencoded it reads: (hierna: de Wet)

Many thanks,

Diederik

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hello Diederik,

It depends on what's the
analyzerhttp://www.elasticsearch.org/guide/reference/index-modules/analysis/you're
using for both indexing and searching. For example, if on indexing
you have not_analyzed and you have a string with parentheses, the generated
token will include everything, even the parentheses. But when you search,
the default query
stringhttp://www.elasticsearch.org/guide/reference/query-dsl/query-string-query/uses
the standard
analyzerhttp://www.elasticsearch.org/guide/reference/index-modules/analysis/standard-analyzer/.
Which will take out your parentheses as if you didn't specify them.

You can use the analyze
APIhttp://www.elasticsearch.org/guide/reference/api/admin-indices-analyze/to
check how various analyzers break down your text. For example, the
standard analyzer escapes parentheses:

curl -XGET 'localhost:9200/_analyze?analyzer=standard&pretty' -d '(test)'

{
"tokens" : [ {
"token" : "test",
"start_offset" : 1,
"end_offset" : 5,
"type" : "",
"position" : 1
} ]
}

Best regards,
Radu

http://sematext.com/ -- Elasticsearch -- Solr -- Lucene

On Sat, Jul 27, 2013 at 10:16 PM, diederik@tenhorses.com wrote:

Dear list,

We are running EC on top of a Mongo DB and it works great. An iPhone
client queries EC through http calls.

I would like to be able to have the search term include parentheses and a
colon, I have tried to escape and encode the parentheses as per the Lucene
docs (see sample query string below), but it does not seem to work
properly, is there anybody out there who knows how to do this?

?q=rechtsgebied_rechtspraak:%22Belasting%22+%22%5C%28hierna%5C:%20de%20Wet%5C%29%22&default_operator=AND&sort=datum_gepubliceerd_ymd:desc&size=20&from=0

This part is what this request is
about: %22%5C%28hierna%5C:%20de%20Wet%5C%29%22

Unencoded it reads: (hierna: de Wet)

Many thanks,

Diederik

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Here is an example query with the query_string. Note that the parenthesis
are there, but they act as if they aren't (because they aren't needed but
are still logically correct):

{
"from" : 0,
"size" : 20,
"query" : {
"bool" : {
"must" : {
"query_string" : {
"query" : "(gn: curly)"
}
}
}
},
"version" : true,
"explain" : false,
"fields" : [ "_ttl", "_source" ]
}

And here is the JSON source from the response:

{ "telno" : "7214560001" , "cnam" : "THREE STOOGES" , "gn" : "Larry, Curly,
and Moe" , "o" : "Columbia Pictures" , "addr" : "Grover St" , "city" :
"Hollywood" , "state" : "CA" }

On Saturday, July 27, 2013 3:16:58 PM UTC-4, died...@tenhorses.com wrote:

Dear list,

We are running EC on top of a Mongo DB and it works great. An iPhone
client queries EC through http calls.

I would like to be able to have the search term include parentheses and a
colon, I have tried to escape and encode the parentheses as per the Lucene
docs (see sample query string below), but it does not seem to work
properly, is there anybody out there who knows how to do this?

?q=rechtsgebied_rechtspraak:%22Belasting%22+%22%5C%28hierna%5C:%20de%20Wet%5C%29%22&default_operator=AND&sort=datum_gepubliceerd_ymd:desc&size=20&from=0

This part is what this request is
about: %22%5C%28hierna%5C:%20de%20Wet%5C%29%22

Unencoded it reads: (hierna: de Wet)

Many thanks,

Diederik

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Thank you Radu, will look into this tomorrow,

Diederik

Verstuurd vanaf mijn iPhone

Op 30 jul. 2013 om 17:57 heeft Radu Gheorghe radu.gheorghe@sematext.com het volgende geschreven:

Hello Diederik,

It depends on what's the analyzer you're using for both indexing and searching. For example, if on indexing you have not_analyzed and you have a string with parentheses, the generated token will include everything, even the parentheses. But when you search, the default query string uses the standard analyzer. Which will take out your parentheses as if you didn't specify them.

You can use the analyze API to check how various analyzers break down your text. For example, the standard analyzer escapes parentheses:

curl -XGET 'localhost:9200/_analyze?analyzer=standard&pretty' -d '(test)'

{
"tokens" : [ {
"token" : "test",
"start_offset" : 1,
"end_offset" : 5,
"type" : "",
"position" : 1
} ]
}

Best regards,
Radu

http://sematext.com/ -- Elasticsearch -- Solr -- Lucene

On Sat, Jul 27, 2013 at 10:16 PM, diederik@tenhorses.com wrote:

Dear list,

We are running EC on top of a Mongo DB and it works great. An iPhone client queries EC through http calls.

I would like to be able to have the search term include parentheses and a colon, I have tried to escape and encode the parentheses as per the Lucene docs (see sample query string below), but it does not seem to work properly, is there anybody out there who knows how to do this?

?q=rechtsgebied_rechtspraak:%22Belasting%22+%22%5C%28hierna%5C:%20de%20Wet%5C%29%22&default_operator=AND&sort=datum_gepubliceerd_ymd:desc&size=20&from=0

This part is what this request is about: %22%5C%28hierna%5C:%20de%20Wet%5C%29%22

Unencoded it reads: (hierna: de Wet)

Many thanks,

Diederik

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.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/nVuj_7jImJ8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Thank you, will look into this tomorrow,

Diederik

Verstuurd vanaf mijn iPhone

Op 30 jul. 2013 om 20:49 heeft InquiringMind brian.from.fl@gmail.com het volgende geschreven:

Here is an example query with the query_string. Note that the parenthesis are there, but they act as if they aren't (because they aren't needed but are still logically correct):

{
"from" : 0,
"size" : 20,
"query" : {
"bool" : {
"must" : {
"query_string" : {
"query" : "(gn: curly)"
}
}
}
},
"version" : true,
"explain" : false,
"fields" : [ "_ttl", "_source" ]
}

And here is the JSON source from the response:

{ "telno" : "7214560001" , "cnam" : "THREE STOOGES" , "gn" : "Larry, Curly, and Moe" , "o" : "Columbia Pictures" , "addr" : "Grover St" , "city" : "Hollywood" , "state" : "CA" }

On Saturday, July 27, 2013 3:16:58 PM UTC-4, died...@tenhorses.com wrote:

Dear list,

We are running EC on top of a Mongo DB and it works great. An iPhone client queries EC through http calls.

I would like to be able to have the search term include parentheses and a colon, I have tried to escape and encode the parentheses as per the Lucene docs (see sample query string below), but it does not seem to work properly, is there anybody out there who knows how to do this?

?q=rechtsgebied_rechtspraak:%22Belasting%22+%22%5C%28hierna%5C:%20de%20Wet%5C%29%22&default_operator=AND&sort=datum_gepubliceerd_ymd:desc&size=20&from=0

This part is what this request is about: %22%5C%28hierna%5C:%20de%20Wet%5C%29%22

Unencoded it reads: (hierna: de Wet)

Many thanks,

Diederik

--
You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/nVuj_7jImJ8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.