[stackoverflow] [progress Openedge Abl] Elasticsearch Kibana Regex To Find Phone Number...

Status
Not open for further replies.
S

Sharath

Guest
I tried using the follow query to search for all those which are like phone number within elastic search.

This was the query I tried. However, it does not give me the right answer.

{
"query": {
"bool": {
"must": [
{
"query": {
"regexp": {
"content": "((\\([0-9]{3}\\) ?)|([0-9]-))?[0-9]-[0-9]{4}"
}
}
},
{
"query": {
"match": {
"_id": {
"query": "1042d6b497124c65b44fdcf86e6986d3.185159"
}
}
}
}
]
}
}
}


This is to capture numbers in this format within the text (123) 456-7890

I tried this query as well

{
"query": {
"bool": {
"must": [
{
"query": {
"regexp": {
"_all":
{
"value" : "content: ((\\([0-9]{3}\\) ?)|([0-9]-))?[0-9]-[0-9]{4}"
}
}
}
},
{
"query": {
"match": {
"_id": {
"query": "1042d6b497124c65b44fdcf86e6986d3.185159"
}
}
}
}
]
}
}
}


The _id does exist and that is being captured when I write that part of the query separately

Any help would be appreciated.

Thanks, Sharath

Continue reading...
 
Status
Not open for further replies.
Top