wall-e
wall-e

Reputation: 173

elasticsearch get only docs in a specific folder

i use elasticsearch to get some documents, in these doc i have a field path like

c:/doc1/doc2/name_of_doc

so i would like to get only the documents in the doc2 root i do not want the documents in a subfolder of doc2

I test the prefix options but if i use that the doc in subfolder will appear

so is it possible to get all doc directly in "c:/doc1/doc2/" with a regex,

or is it possible to add the name of the file in my query? (the name is stored in elasticsearch) like

"c:/doc1/doc2/" . name.value

Upvotes: 0

Views: 146

Answers (1)

wall-e
wall-e

Reputation: 173

i Find it thanks

filter ['bool'] ['should'] [] = array (
                'regexp' => array (
                        'ecm:path' => "c:\/doc1/doc2\/([^\/]*)"
          )
);

Upvotes: 0

Related Questions