Message Boards

Unable to reindex for custom entity having primary key as type String

Ritu Kishore, modified 2 Years ago.

Unable to reindex for custom entity having primary key as type String

New Member Posts: 5 Join Date: 8/3/21 Recent Posts

Hi,

I'm implementing serch and indexing feature by following Search and Indexing in my custom entity having primary key as of type String in liferay 7.3.

But the issue which I'm facing is in reindexing, I'm not able to reindex from control panel -> search as it is giving a null pointer exception as  method getIndexableActionableDynamicQuery() in entityLocalService is not getting created which was automatically been created when entity primary key is of long type.

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 :

javax.portlet.PortletException: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long

Besides if I tried to reindex programatically by calling indexer.reindexer(companyIds[]) then I'm getting null pointer exception.

It will be great if ony one of you help me in proceeding with this.

Thanks,

Ritu