Wildcard search / query via REST request URI


(Lam Pham) #1

Hi,
Is it possible to do a wildcard search via
the request URI? For example
http://localhost:9200/index1/type1/_search?q=type1.text_ID=*

If yes, what is the correct format? I tried the above
format and did not get any hit for my data.

I'm new to ElasticSearch. So, please pardon me if
this question had been asked before. I did some search
but could not find the answer.

Thanks,
Lam

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c516a69e-eb3d-47ba-bef5-3e56823b7d5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(David Pilato) #2

URI Search is mapped to query string

See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-uri-request.html
And http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

Although it should work, you should not use that in production. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html#query-dsl-wildcard-query

Note this query can be slow, as it needs to iterate over many terms.

For a end user query, you should define a better analyzer than the default one and use ngrams.

My 2 cents.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 30 mai 2014 à 20:18, Lam Pham lacda97@gmail.com a écrit :

Hi,
Is it possible to do a wildcard search via
the request URI? For example
http://localhost:9200/index1/type1/_search?q=type1.text_ID=*

If yes, what is the correct format? I tried the above
format and did not get any hit for my data.

I'm new to ElasticSearch. So, please pardon me if
this question had been asked before. I did some search
but could not find the answer.

Thanks,
Lam

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c516a69e-eb3d-47ba-bef5-3e56823b7d5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/F1B0996A-FB32-4308-B23C-ED5809DA5CBF%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.


(Lam Pham) #3

Thanks David.
On Friday, May 30, 2014 11:14:15 PM UTC-4, David Pilato wrote:

URI Search is mapped to query string

See
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-uri-request.html
And
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

Although it should work, you should not use that in production. See
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html#query-dsl-wildcard-query

Note this query can be slow, as it needs to iterate over many terms.

For a end user query, you should define a better analyzer than the default
one and use ngrams.

My 2 cents.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 30 mai 2014 à 20:18, Lam Pham <lac...@gmail.com <javascript:>> a
écrit :

Hi,
Is it possible to do a wildcard search via
the request URI? For example
http://localhost:9200/index1/type1/_search?q=type1.text_ID=*

If yes, what is the correct format? I tried the above
format and did not get any hit for my data.

I'm new to ElasticSearch. So, please pardon me if
this question had been asked before. I did some search
but could not find the answer.

Thanks,
Lam

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/c516a69e-eb3d-47ba-bef5-3e56823b7d5f%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/c516a69e-eb3d-47ba-bef5-3e56823b7d5f%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/fae15ce2-53ca-4e2d-b9e0-58c4cfb5f368%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4