Message Boards

How to associate custom entity with Segments in liferay 7.3

Ritu Kishore, modified 2 Years ago.

How to associate custom entity with Segments in liferay 7.3

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

I'm extending Segments Criteria Contributor with some custom segment rules in liferay 7.3, and for this I had created a contributor class which implements SegmentsCriteriaContributor. After deployong the module, a new segment criteria contributor  was added  with the rule I had defined within the class.

Now the issue which I'm facing is that how to associate this custom criteria contributor  with a custom entity to return the number of matched data.

I tried to follow Creating-a-Segment-Criteria-Contributor for my reference but the issue which I face was that while it was performing search in ODataRetriver, I was getting null pointer exception as my entity is not indexable and I don't want this to be indexable.

So it will be a great help if someone could help me ith this.

Thanks

thumbnail
Olaf Kock, modified 2 Years ago.

RE: How to associate custom entity with Segments in liferay 7.3

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts

Disclaimer: I've not followed the whole documentation chapter, never implemented this, and might have missed something.

You claim that you don't implement indexing - and you don't want to. On the other hand, that might be just what the framework expects: There are many operations that are implemented through the index in order to lower the demand on the database, and/or improve performance. In case you've hit exactly this situation (I'm neither claiming you do or you don't), it's your choice if you work around this by figuring out how to replace index-based search with database-based search, or to implement indexing. Indexing might come in handy in other situations as well...

Ritu Kishore, modified 2 Years ago.

RE: RE: How to associate custom entity with Segments in liferay 7.3

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

Hi Olaf,

Thanks for your response..!!

I ended up with making my entity indexable and now it is working as per our requirements.

Thanks