<?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>Waiting for the Indexer when adding a new entity</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120551003" />
  <subtitle>Waiting for the Indexer when adding a new entity</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120551003</id>
  <updated>2026-04-05T17:59:15Z</updated>
  <dc:date>2026-04-05T17:59:15Z</dc:date>
  <entry>
    <title>Waiting for the Indexer when adding a new entity</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120551002" />
    <author>
      <name>Dominik Marks</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120551002</id>
    <updated>2021-01-15T10:46:53Z</updated>
    <published>2021-01-15T10:46:53Z</published>
    <summary type="html">&lt;p&gt;Hello there,&lt;/p&gt;
&lt;p&gt;I have the following problem.&lt;/p&gt;
&lt;p&gt;I have a custom entity build using the service builder. The
  &amp;quot;add&amp;quot; method is annotated with @Indexable(type=REINDEX). So
  when adding a new entity it is added to the index, too. &lt;/p&gt;
&lt;p&gt;Adding the entity is started from an MVCActionCommand. After that an
  MVCRenderCommand is invoked to show all entities in a result page.The
  MVCRenderCommand invokes a search to find all entities. &lt;/p&gt;
&lt;p&gt;The search results in the MVCRenderCommand however does not contain
  the entity that was added in the current request. &lt;br /&gt;
  &lt;br /&gt;If I reload the page so that the MVCRenderCommand is invoked
  again the entity added before is found in the search result.&lt;/p&gt;
&lt;p&gt;Is it possible to somehow &amp;quot;wait&amp;quot; for the entity to be fully
  indexed before returning from the &amp;quot;add&amp;quot; method in the service?&lt;/p&gt;</summary>
    <dc:creator>Dominik Marks</dc:creator>
    <dc:date>2021-01-15T10:46:53Z</dc:date>
  </entry>
</feed>
