<?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>Searching and indexing custom Entity in Liferay 7.4 Using Elastic Search</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121436802" />
  <subtitle>Searching and indexing custom Entity in Liferay 7.4 Using Elastic Search</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121436802</id>
  <updated>2026-04-07T12:10:57Z</updated>
  <dc:date>2026-04-07T12:10:57Z</dc:date>
  <entry>
    <title>RE: RE: Searching and indexing custom Entity in Liferay 7.4 Using Elastic Search</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121437660" />
    <author>
      <name>Amresh kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121437660</id>
    <updated>2022-06-02T16:18:39Z</updated>
    <published>2022-06-02T16:13:13Z</published>
    <summary type="html">&lt;p&gt;Thanks a lot Russell for your prompt response.&lt;/p&gt;
&lt;p&gt;Finally I have implemented the permission and now working fine.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Amresh kumar</dc:creator>
    <dc:date>2022-06-02T16:13:13Z</dc:date>
  </entry>
  <entry>
    <title>RE: Searching and indexing custom Entity in Liferay 7.4 Using Elastic Search</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121437280" />
    <author>
      <name>Russell Bohl</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121437280</id>
    <updated>2022-06-02T15:30:14Z</updated>
    <published>2022-06-02T15:30:14Z</published>
    <summary type="html">&lt;p&gt;Hi Amresh, with the new composite indexing framework it is no longer
  possible (as far as I know) to set permissions aware to false.&lt;/p&gt;
&lt;p&gt;
  &lt;a
    href="https://help.liferay.com/hc/en-us/articles/360022194411-Indexing-Framework#permissions-aware-searching-and-indexing"&gt;Indexing
    Introduction in Liferay Help Center&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;However, you can probably get the behavior you want (I am guessing
  you want unauthenticated users to be able to search for your entity)
  by allowing guests to view the asset.&lt;/p&gt;</summary>
    <dc:creator>Russell Bohl</dc:creator>
    <dc:date>2022-06-02T15:30:14Z</dc:date>
  </entry>
  <entry>
    <title>Searching and indexing custom Entity in Liferay 7.4 Using Elastic Search</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121436801" />
    <author>
      <name>Amresh kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121436801</id>
    <updated>2022-06-02T16:34:24Z</updated>
    <published>2022-06-02T05:07:48Z</published>
    <summary type="html">&lt;pre&gt;
&lt;code class="language-java"&gt;@Component(immediate = true)

public class EmployeeEntryModelResourcePermissionRegistrar {

@Activate

public void activate(BundleContext bundleContext) {

Dictionary&amp;lt;String, Object&amp;gt; properties = new HashMapDictionary&amp;lt;&amp;gt;();

properties.put(&amp;quot;model.class.name&amp;quot;, Employee.class.getName());

_serviceRegistration = bundleContext.registerService(

ModelResourcePermission.class,

ModelResourcePermissionFactory.create(

Employee.class, Employee::getEmployeeId,

_empoloyeeLocalService::getEmployee, _portletResourcePermission,

(modelResourcePermission, consumer) -&amp;gt; {

consumer.accept(

new StagedModelPermissionLogic&amp;lt;&amp;gt;(

_stagingPermission, &amp;quot;com_test_TestDemoPortlet&amp;quot;,

Employee::getEmployeeId));

  consumer.accept( new WorkflowedModelPermissionLogic&amp;lt;&amp;gt;( _workflowPermission,

  modelResourcePermission, _groupLocalService, Employee::getEmployeeId));

}),properties);

}

@Deactivate

public void deactivate() {

_serviceRegistration.unregister();

}@Reference

private EmployeeLocalService _empoloyeeLocalService;

@Reference(target = &amp;quot;(resource.name=&amp;quot; + &amp;quot;com.emp.service.employee&amp;quot; + &amp;quot;)&amp;quot;)

private PortletResourcePermission _portletResourcePermission;

private ServiceRegistration&amp;lt;ModelResourcePermission&amp;gt; _serviceRegistration;

@Reference

private StagingPermission _stagingPermission;

@Reference

private WorkflowPermission _workflowPermission;

@Reference

private GroupLocalService _groupLocalService;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have developed the Indexer by extending &lt;strong&gt;BaseIndexer and
  &lt;/strong&gt;there is an option to disabled the permission check &lt;/p&gt;
&lt;p&gt;setPermissionAware(&lt;b&gt;false&lt;/b&gt;); is working absolutly fine.&lt;/p&gt;
&lt;p&gt;Try to use the newer approach as below for indexing
  , &lt;strong&gt;setPermissionAware(true/false)&lt;/strong&gt; is not longer necessary.&lt;/p&gt;
&lt;p&gt;
  &lt;strong&gt;How to disabled permission in newer approach any idea ?&lt;/strong&gt;&lt;/p&gt;</summary>
    <dc:creator>Amresh kumar</dc:creator>
    <dc:date>2022-06-02T05:07:48Z</dc:date>
  </entry>
</feed>
