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:
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."
What is the mapping in Elasticsearch for this field? Use the get mapping API to find out.
If you have not specified mappings it is likely that you are using dynamic mappings, and in that case file is mapped as an analyzed text field on which regexp will not work. Instead try using file.keyword and see if that helps.
As well as using ‘file.keyword’ as the field name in your query try use ‘.*’ at the beginning and end of the regex string if you’re only supplying part of the file name in the search
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.