<?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>Unable to reindex for custom entity having primary key as type String</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121149077" />
  <subtitle>Unable to reindex for custom entity having primary key as type String</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121149077</id>
  <updated>2026-04-06T02:16:16Z</updated>
  <dc:date>2026-04-06T02:16:16Z</dc:date>
  <entry>
    <title>Unable to reindex for custom entity having primary key as type String</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121149076" />
    <author>
      <name>Ritu Kishore</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121149076</id>
    <updated>2021-09-16T20:16:19Z</updated>
    <published>2021-09-16T04:21:48Z</published>
    <summary type="html">&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I'm implementing serch and indexing feature by following &lt;a
    href="https://help.liferay.com/hc/en-us/articles/360034199432-Understanding-Search-and-Indexing"&gt;Search
    and Indexing&lt;/a&gt; in my custom entity having primary key as of type
  String in liferay 7.3.&lt;/p&gt;
&lt;p&gt;But the issue which I'm facing is in reindexing, I'm not able to
  reindex from control panel -&amp;gt; search as it is giving a null pointer
  exception as 
  method &lt;strong&gt;getIndexableActionableDynamicQuery()&lt;/strong&gt; in
  entityLocalService is not getting created which was automatically been
  created when entity primary key is of long type.&lt;/p&gt;
&lt;p&gt;I also tried to reindexing it programatically by calling
  indexer.reindexer(collection_obj  entity)
  and indexer.reindexer(entity_obj) but was getting the same error :&lt;/p&gt;
&lt;p&gt;
  &lt;strong&gt;javax.portlet.PortletException: java.lang.ClassCastException:
    java.lang.String cannot be cast to java.lang.Long&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Besides if I tried to reindex programatically by
  calling indexer.reindexer(companyIds[]) then I'm getting null pointer exception.&lt;/p&gt;
&lt;p&gt;It will be great if ony one of you help me in proceeding with this.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Ritu&lt;/p&gt;</summary>
    <dc:creator>Ritu Kishore</dc:creator>
    <dc:date>2021-09-16T04:21:48Z</dc:date>
  </entry>
</feed>
