i made index and inserted a document about phone number like below
# curl -XPOST localhost:9200/testindex?pretty -d '{
> "mappings": {
> "document": {
> "properties": {
> "name": {
> "type": "string"
> }
> }
> }
> }
> }'
{
"acknowledged" : true
}
# curl -XPUT localhost:9200/testindex/document/1?pretty -d '{"name": "010-1111-2222"}'
{
"_index" : "testindex",
"_type" : "document",
"_id" : "1",
"_version" : 1,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"created" : true
}
And, i searched with regular expression. but no found..
what is wrong??
# curl -XGET localhost:9200/testindex/document/_search?pretty -d '{
> "query": {
> "query_string": {
> "query": "name:/010-[0-9]{4}-[0-9]{4}/"
> }
> }
> }'
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 10,
"successful" : 10,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}