This one is working:

GET test/test1/_search
{
  "query": {
    "wildcard": {
      "TextProperty": "*This*"
    }
  }
}

But note that you should not do that.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html

Note this query can be slow, as it needs to iterate over many terms. In order 
to prevent extremely slow wildcard queries, a wildcard term should not start 
with one of the wildcards * or ?.

You'd better use a ngram token filter.

My 2 cents

-- 
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr


Le 4 juillet 2014 à 10:22:53, Aarón Martín Bermejo ([email protected]) a écrit:

Someone can help me please?

El miércoles, 25 de junio de 2014 10:11:43 UTC+2, Aarón Martín Bermejo escribió:
Hello,

My problem is that I have a not_analyzed field and I'm doing a query_string 
query over it searching the first word of the field. That query doesn't return 
anything. It can be reproduced doing the next steps:

1. Create an index with the next mapping: http://pastebin.com/Bz4qxEDS

2. Index an object at the index "test1" with the next json: {"TextProperty": 
"This-is-a-test-property"}

3. Make the next query: {"query": {"bool": {"must": [{"query_string": 
{"default_field": "TextProperty","query": "*This*"}}]}}}

The query does not return anything. But if I change the query for "*his*" it 
doues return the object previously indexed.

I'm doing this query because I want to make a query that returns every result 
that "contains" the value I'm searching. I don't know if it's normal that over 
not_indexed fields the query string queries don't work as expected or maybe I 
should make another kind of query or anything else. The point is that that 
query does not work.

I'm open to any solution.
--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/fce70d28-69e4-47a4-9a44-97dc9202097d%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/etPan.53b66b79.41b71efb.2fae%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/d/optout.

Reply via email to