Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Сustom entity indexing breaks after portlet redeployment
Hi,
we discovered some strange behaviour on Liferay 6.2.10 EE. We have a custom portlet, custom entity and implemented indexer for it. In CustomEntityLocalServiceImpl class there is update method for our entity.
The problem is that if we annotate update method with
But if we remove this annotation and add inside update method direct call of
Inspection of liferay sources showed that in second case registry returns not indexer, but indexer proxy which is not updated on portlet redeployment.
We've found that if we set property index.request.buffer.enabled to false, than registry util returns indexer instance insite of proxy object and everything works fine. But I didn't manage to find any documentation for this property.
Could anyone tell me, why annotation and direct call of registry works different and consult on index.request.buffer.enabled property and possible effects of setting it to false?
Thanks
we discovered some strange behaviour on Liferay 6.2.10 EE. We have a custom portlet, custom entity and implemented indexer for it. In CustomEntityLocalServiceImpl class there is update method for our entity.
The problem is that if we annotate update method with
@Indexable(type = IndexableType.REINDEX)
reindex process is called correctly after update operation.But if we remove this annotation and add inside update method direct call of
Indexer indexer = IndexerRegistryUtil.nullSafeGetIndexer(CustomEntity.class);
reindex doesn't work after portlet redeploy (it works only after server restart). Inspection of liferay sources showed that in second case registry returns not indexer, but indexer proxy which is not updated on portlet redeployment.
We've found that if we set property index.request.buffer.enabled to false, than registry util returns indexer instance insite of proxy object and everything works fine. But I didn't manage to find any documentation for this property.
Could anyone tell me, why annotation and direct call of registry works different and consult on index.request.buffer.enabled property and possible effects of setting it to false?
Thanks
Hi Olga,
I don't have access to the 6.2 EE source, but I can tell you that the property is not part of the CE edition. As an EE customer though, you should be able to access the source to reference. The behaviour between the annotation and the IndexerRegitryUtil is odd -- certainly sounds like a bug. For the property though, here is what I would suggest (after you have downloaded and unpacked the source)
1. First open the portal.properties file (from portal-impl) and look the property up in there. Liferay does a really good job (imho) of adding comments to properties that help explain what they're used for -- so you might find your answer right inline.
... if that doesn't work ...
2. Open the file PropsKeys and look up the property. That should take you to the line where you can see the constant which is most likely INDEX_REQUEST_BUFFER_ENABLED as this is the pattern that Liferay uses for naming conventions and such. Once you have that you can search the entire code base for that constants and I am willing to bet only one or two locations will come up. I would imagine at that point it would only take you a few minutes of reviewing the code to reveal the mystery
I'm sorry that I can't give you a definitive answer, but I am happy to help in your hunt -- but you have to be the hands at the keyboard since I don't have the source. If you do take this advice, let us kow what you find -- I am curious!
I don't have access to the 6.2 EE source, but I can tell you that the property is not part of the CE edition. As an EE customer though, you should be able to access the source to reference. The behaviour between the annotation and the IndexerRegitryUtil is odd -- certainly sounds like a bug. For the property though, here is what I would suggest (after you have downloaded and unpacked the source)
1. First open the portal.properties file (from portal-impl) and look the property up in there. Liferay does a really good job (imho) of adding comments to properties that help explain what they're used for -- so you might find your answer right inline.
... if that doesn't work ...
2. Open the file PropsKeys and look up the property. That should take you to the line where you can see the constant which is most likely INDEX_REQUEST_BUFFER_ENABLED as this is the pattern that Liferay uses for naming conventions and such. Once you have that you can search the entire code base for that constants and I am willing to bet only one or two locations will come up. I would imagine at that point it would only take you a few minutes of reviewing the code to reveal the mystery

I'm sorry that I can't give you a definitive answer, but I am happy to help in your hunt -- but you have to be the hands at the keyboard since I don't have the source. If you do take this advice, let us kow what you find -- I am curious!
Hi Olga,
About the problem related to indexer proxy is not updated:
Index Buffer avoids to index same object more than once, see full explanation in that LPS-69361. In case that buffer is deactivated, unnecessary index operations will be done.
Without Index Buffer, some customers has also detected out-of-sync indexations: last index request is not indexed in last place, so wrong data is indexed. But that issue is not very common and is only produced in case having CPU shortage or a CPU with a small number of cores.
About why annotation works in a different way than getting the indexer from registry, that is very stange as annotation internally also gets indexer from registry, see code from IndexableAdvice:
In my opinion, the only explanation is that behavior is caused by classloaders, but I am not sure.
As you are using an Enterprise version of Liferay, if you need more information my advice is to open a ticket to Liferay Enterprise Support service.
Regards,
Jorge
About the problem related to indexer proxy is not updated:
Inspection of liferay sources showed that in second case registry returns not indexer, but indexer proxy which is not updated on portlet redeployment. I have reviewed 7.0, 7.1 and master source code and it seems that issue is already solved in newer versions:As Liferay 6.2 is in Limited support phase, that issue won't be solved in that version.
We've found that if we set property index.request.buffer.enabled to false, than registry util returns indexer instance insite of proxy object and everything works fine. But I didn't manage to find any documentation for this property.index.request.buffer.enabled is related to 7.0 Index Buffer functionality that was backported to 6.2 version in https://issues.liferay.com/browse/LPS-69361
Could anyone tell me, why annotation and direct call of registry works different and consult on index.request.buffer.enabled property and possible effects of setting it to false?
Index Buffer avoids to index same object more than once, see full explanation in that LPS-69361. In case that buffer is deactivated, unnecessary index operations will be done.
Without Index Buffer, some customers has also detected out-of-sync indexations: last index request is not indexed in last place, so wrong data is indexed. But that issue is not very common and is only produced in case having CPU shortage or a CPU with a small number of cores.
About why annotation works in a different way than getting the indexer from registry, that is very stange as annotation internally also gets indexer from registry, see code from IndexableAdvice:
In my opinion, the only explanation is that behavior is caused by classloaders, but I am not sure.
As you are using an Enterprise version of Liferay, if you need more information my advice is to open a ticket to Liferay Enterprise Support service.
Regards,
Jorge
Hi Jorge,
That explains why I couldn't find the property! Thanks for sharing that. Question for you though. Is there a place we can look to in order to find backported functionality linked to properties? Or is this possibly a case of the GA6 bundles was updated post release and the version I have is out of date maybe?
That explains why I couldn't find the property! Thanks for sharing that. Question for you though. Is there a place we can look to in order to find backported functionality linked to properties? Or is this possibly a case of the GA6 bundles was updated post release and the version I have is out of date maybe?
Hi Andrew,
About your question:
Property documentation added during a bug fix is normally included in the portal.properties of the Liferay sources of the specific version.
That property was added in LPS-69361 that was released only in Liferay Portal 6.2 EE, fixpack 134 (Feb 2017), so it will be only available in the source code of the enterprise version, starting with fixpack 134.
6.2 CE GA6 was released before that EE fixpack (Jan 2016).
index.request.buffer.enabled property doesn't exists in Liferay 7.x as it was added in new System Settings section, see: https://dev.liferay.com/en/discover/portal/-/knowledge_base/7-1/configuring-search#index-registry
About your question:
That explains why I couldn't find the property! Thanks for sharing that. Question for you though. Is there a place we can look to in order to find backported functionality linked to properties? Or is this possibly a case of the GA6 bundles was updated post release and the version I have is out of date maybe?
Property documentation added during a bug fix is normally included in the portal.properties of the Liferay sources of the specific version.
That property was added in LPS-69361 that was released only in Liferay Portal 6.2 EE, fixpack 134 (Feb 2017), so it will be only available in the source code of the enterprise version, starting with fixpack 134.
6.2 CE GA6 was released before that EE fixpack (Jan 2016).
index.request.buffer.enabled property doesn't exists in Liferay 7.x as it was added in new System Settings section, see: https://dev.liferay.com/en/discover/portal/-/knowledge_base/7-1/configuring-search#index-registry
Ah .. I see. Ok, thanks for clearing that up Jorge. It's good to know at least that I'm not losing my mind

Hi Jorge and Andrew,
thank you for your answers. They made this liferay behaviour clearer for me. We'll try to inspect one more time our application to discover why annotation and direct indexer call works different, and if we'll manage to find the reason I'll definetely write here about the results.
Thank you!
BR,
Olga
thank you for your answers. They made this liferay behaviour clearer for me. We'll try to inspect one more time our application to discover why annotation and direct indexer call works different, and if we'll manage to find the reason I'll definetely write here about the results.
Thank you!
BR,
Olga
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™