Fórum

show very large data in liferay search container

sanket jani, modificado 8 Anos atrás.

show very large data in liferay search container

New Member Postagens: 21 Data de Entrada: 09/04/15 Postagens Recentes
hello everyone
i am using liferay 6.2

i have one problem with liferay search container.

i have to show 50000 data from the table to the liferay search container
but problem with that is page doesn't getting load and it is get crashed. .

i have also tried the jquery table but same problem persist there.

if you have any idea to deal with that large data showing problem than please help me into this.
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: show very large data in liferay search container

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
That's ridiculous.

I think if you check the source of the crash you'll find you're consuming too much resources to try to render everything for this 50k result set.

No one shows 50k results. No human is capable of correctly processing 50k rows worth of data, that's why you don't see it anywhere.
thumbnail
Ravi Kumar Gupta, modificado 8 Anos atrás.

RE: show very large data in liferay search container

Liferay Legend Postagens: 1302 Data de Entrada: 24/06/09 Postagens Recentes
Try Pagination. emoticon
thumbnail
Pankaj Kathiriya, modificado 8 Anos atrás.

RE: show very large data in liferay search container

Liferay Master Postagens: 722 Data de Entrada: 05/08/10 Postagens Recentes
It seems you are fetching all the 50K records in order to just show delta records in searchcontrainer, which is very bad practice and causing you performance issues.

You have to fetch only records which are to be display using searchContainer's start and end attributes, see the liferay source code you will find many example to achieve that.
sanket jani, modificado 8 Anos atrás.

RE: show very large data in liferay search container

New Member Postagens: 21 Data de Entrada: 09/04/15 Postagens Recentes
hello everyone ,
following code i have used to display data.
is there any wrong to display 50000 records by using searchcontainer
i am passing delta 10 so it should retrieve 10 records only


<liferay-ui:search-container id="identification" emptyresultsmessage="No records availabe" delta="10" iteratorurl="<%=renderResponse.createRenderURL() %>">
	<liferay-ui:search-container-results results="<%=IdentificationLocalServiceUtil.getIdentifications(searchContainer.getStart(),searchContainer.getEnd())%>" total="<%=IdentificationLocalServiceUtil.getIdentificationsCount()%>">
	</liferay-ui:search-container-results>
	<liferay-ui:search-container-row classname="com.krishtec.temple.dbcore.model.Identification" modelvar="idobj">
		<liferay-ui:search-container-column-text title="PREACHER NAME" cssClass="searchContainerColumnText" name="Preacher Name" value="<%=String.valueOf(idobj.getPreacherName()) %>" />
		<liferay-ui:search-container-column-text cssClass="searchContainerColumnText" name="Devotee Name" value="<%=String.valueOf(idobj.getFirstName()) %>" />
				 
	</liferay-ui:search-container-row>
	<liferay-ui:search-iterator />
</liferay-ui:search-container>
thumbnail
Tina Agrawal, modificado 8 Anos atrás.

RE: show very large data in liferay search container

Expert Postagens: 297 Data de Entrada: 03/01/08 Postagens Recentes
You are passing the start and end but are you also using them in the java classes to get only those many results?

Tina
sanket jani, modificado 8 Anos atrás.

RE: show very large data in liferay search container

New Member Postagens: 21 Data de Entrada: 09/04/15 Postagens Recentes
i couldn't get you what you are trying to ask.


but are you also using them in the java classes to get only those many results


here we are getting all the records from the DB table and parsing list on search container .
thumbnail
Tina Agrawal, modificado 8 Anos atrás.

RE: show very large data in liferay search container

Expert Postagens: 297 Data de Entrada: 03/01/08 Postagens Recentes
What I mean is when you are querying your DB does your query say get only 10 records or it gets all 50K records and pass them to search container.
If your DB is returning all 50K results then you need to change your query and get only the records for that pagination say - 1st 10, or next 20.

Tina
sanket jani, modificado 8 Anos atrás.

RE: show very large data in liferay search container

New Member Postagens: 21 Data de Entrada: 09/04/15 Postagens Recentes
we have now following code which should retrieve only first 50 records

	<liferay-ui:search-container-results results="<%=IdentificationLocalServiceUtil.getIdentifications(0,50)%>" total="50">
</liferay-ui:search-container-results>

and browser doesn't response on pagination.
any idea what might be root cause.
thumbnail
Pankaj Kathiriya, modificado 8 Anos atrás.

RE: show very large data in liferay search container

Liferay Master Postagens: 722 Data de Entrada: 05/08/10 Postagens Recentes
Well, you are specifying total as 50, so it assumes there are no more records so pagination controls will be disabled, which is correct behavior..
sanket jani, modificado 8 Anos atrás.

RE: show very large data in liferay search container

New Member Postagens: 21 Data de Entrada: 09/04/15 Postagens Recentes

<liferay-ui:search-container id="identification" emptyresultsmessage="There are No records" delta="10" iteratorurl="<%=renderResponse.createRenderURL() %>">
	<liferay-ui:search-container-results results="<%=IdentificationLocalServiceUtil.getIdentifications(0,50)%>" total="50">

</liferay-ui:search-container-results></liferay-ui:search-container>


but we have specified delta as 10 .
so pagination should be there with 10 - 10 records.
thumbnail
Tina Agrawal, modificado 8 Anos atrás.

RE: show very large data in liferay search container

Expert Postagens: 297 Data de Entrada: 03/01/08 Postagens Recentes
Sanket,

Delta will take care of displaying 10 records but you bringing all 50000 records.
I suggest you first try some basic example of search container and understand the concept of how it works.

Tina
sanket jani, modificado 8 Anos atrás.

RE: show very large data in liferay search container

New Member Postagens: 21 Data de Entrada: 09/04/15 Postagens Recentes

<liferay-ui:search-container id="identification" emptyresultsmessage="There is No records" delta="10" iteratorurl="<%=renderResponse.createRenderURL() %>">
	<liferay-ui:search-container-results results="<%=IdentificationLocalServiceUtil.getIdentifications(searchContainer.getStart(),searchContainer.getEnd()) %>" total="<%= IdentificationLocalServiceUtil.getIdentificationsCount()%>">
	</liferay-ui:search-container-results>
</liferay-ui:search-container>


here i debug in more detailed,
according to the above code results will manage 10 records according to the pagination.
for example if i am on pagination 2, results will query only 10 records starting from 11 to 20.
so search container should show 11 to 20 records on pagination 2.
also putting more information when we are keeping records around 1000 liferay ui search container works. but if we upload 50000 records page stops responding.

is it possible liferay issue on version 6.2 ce ?
thumbnail
Tina Agrawal, modificado 8 Anos atrás.

RE: show very large data in liferay search container

Expert Postagens: 297 Data de Entrada: 03/01/08 Postagens Recentes
Sanket,

Its not a Liferay issue as such. Its an issue with how you are using it.
See you need to use those start and end parameters when you fetching the records.

Say your DB query would be get me 1-10 records, get me 11-20 records.
Fetching all 50K records or even 1K records is a bad practise.

Tina
sanket jani, modificado 8 Anos atrás.

RE: show very large data in liferay search container

New Member Postagens: 21 Data de Entrada: 09/04/15 Postagens Recentes
as i posted last code it is just querying 10 records only from DB table not all 50K records.

results="<%=IdentificationLocalServiceUtil.getIdentifications(searchContainer.getStart(),searchContainer.getEnd())

do you see anything wrong here ?
thumbnail
Samuel Kong, modificado 8 Anos atrás.

RE: show very large data in liferay search container

Liferay Legend Postagens: 1902 Data de Entrada: 10/03/08 Postagens Recentes
We can't tell from this line of code. What does your IdentificationLocalServiceImpl.getIdentifications method look like? Is it taking into consideration the start and end?
sanket jani, modificado 8 Anos atrás.

RE: show very large data in liferay search container

New Member Postagens: 21 Data de Entrada: 09/04/15 Postagens Recentes
this method is auto generated by the lifery service builder.

IdentificationLocalServiceImpl.getIdentifications
thumbnail
Tina Agrawal, modificado 8 Anos atrás.

RE: show very large data in liferay search container

Expert Postagens: 297 Data de Entrada: 03/01/08 Postagens Recentes
If this a auto generated method it will fetch only those many records.
I dont see an issue.

Did you check where it is hanging. Is it getting stuck in the UI end or your DB query is failing.

Tina
sanket jani, modificado 8 Anos atrás.

RE: show very large data in liferay search container

New Member Postagens: 21 Data de Entrada: 09/04/15 Postagens Recentes

<liferay-ui:search-container-results results="<%=IdentificationLocalServiceUtil.getIdentifications(searchContainer.getStart(),searchContainer.getEnd()) %>" total="<%=IdentificationLocalServiceUtil.getIdentificationsCount()%>">
</liferay-ui:search-container-results>


finally above code worked.
thanks to all for your expert help..
Jakub Rehak, modificado 7 Anos atrás.

RE: show very large data in liferay search container

New Member Postagens: 3 Data de Entrada: 28/02/14 Postagens Recentes
I have the same problem. but i have onlny 101 rows, but on every page, search container shows all of them. what is right configuration of delta,start,end,total for display only 20 row per page ?
thumbnail
pramod kumara, modificado 7 Anos atrás.

RE: show very large data in liferay search container

Junior Member Postagens: 54 Data de Entrada: 29/08/16 Postagens Recentes
while finding the data give end and start as -1, -1