<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Fetching documents via a metadata query (Liferay 7.2)</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118101235" />
  <subtitle>Fetching documents via a metadata query (Liferay 7.2)</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118101235</id>
  <updated>2026-04-07T19:17:11Z</updated>
  <dc:date>2026-04-07T19:17:11Z</dc:date>
  <entry>
    <title>Fetching documents via a metadata query (Liferay 7.2)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118101234" />
    <author>
      <name>Sam Collett</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118101234</id>
    <updated>2019-12-17T11:51:34Z</updated>
    <published>2019-12-17T11:51:34Z</published>
    <summary type="html">Hi,&lt;br /&gt;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 &amp;#39;Review_Date&amp;#39; 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).&lt;br /&gt;&lt;br /&gt;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.  &lt;br /&gt;&lt;br /&gt;Thanks</summary>
    <dc:creator>Sam Collett</dc:creator>
    <dc:date>2019-12-17T11:51:34Z</dc:date>
  </entry>
</feed>
