Message Boards

Fetching documents via a metadata query (Liferay 7.2)

Sam Collett, modified 4 Years ago.

Fetching documents via a metadata query (Liferay 7.2)

New Member Posts: 20 Join Date: 11/11/19 Recent Posts
Hi,
I am currently looking into a way of fetching documents according to the metadata that is set. I have several document types, for instance Policy, Guidance, Procedure etc. They have a 'Review_Date' field (or a variant of) and I wish to retrieve the documents that have it set and with a date within a certain period - within 3 months, one month or past the review date (three lists, for display/email/exporting).

I have had a look at the DLFileEntryMetadataLocalServiceUtil and the dynamicQuery looks like it could be the method to use, but I am not sure how to use it for my particular query. Are there more appropriate methods to use, using the built in ElasticSearch for example? I have also had a brief look at graphql, which looks it might be a more powerful way of getting the information, since you can choose which information to return, but not sure of how to build up the query. 

Thanks