hello everybody,
i'm new in elasticsearch and i'm creating an internal search engine for my company.
i'm try to make a query that must returns only files contained in some paths.
here is my PHP code:
$params['body']['query']['bool']['should']['regexp']['file'] = "/(000_Public|010_Users|020_Private)/";
the query should match any file where path is "foo/000_Public/foo" or "foo/010_Users/foo" etc.
i've tried multiple format
"/(000_Public|010_Users|020_Private)/"
".(000_Public|010_Users|020_Private)."
"000_Public"
".000_Public."
every query return 0 hits
the full request is:
{
"from": 0,
"size": 10,
"type": "_doc",
"body": {
"sort": {
"date": "asc"
},
"query": {
"bool": {
"should": {
"regexp": {
"file": ".*(000_Public|010_Users|020_Private).*"
}
}
}
}
},
"index": "allfiles"
}
help!