Fórumok

show very large data in liferay search container

sanket jani, módosítva 8 év-val korábban

show very large data in liferay search container

New Member Bejegyzések: 21 Csatlakozás dátuma: 2015.04.09. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

Liferay Legend Bejegyzések: 14916 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

Liferay Legend Bejegyzések: 1302 Csatlakozás dátuma: 2009.06.24. Legújabb bejegyzések
Try Pagination. emoticon
thumbnail
Pankaj Kathiriya, módosítva 8 év-val korábban

RE: show very large data in liferay search container

Liferay Master Bejegyzések: 722 Csatlakozás dátuma: 2010.08.05. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

New Member Bejegyzések: 21 Csatlakozás dátuma: 2015.04.09. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

Expert Bejegyzések: 297 Csatlakozás dátuma: 2008.01.03. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

New Member Bejegyzések: 21 Csatlakozás dátuma: 2015.04.09. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

Expert Bejegyzések: 297 Csatlakozás dátuma: 2008.01.03. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

New Member Bejegyzések: 21 Csatlakozás dátuma: 2015.04.09. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

Liferay Master Bejegyzések: 722 Csatlakozás dátuma: 2010.08.05. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

New Member Bejegyzések: 21 Csatlakozás dátuma: 2015.04.09. Legújabb bejegyzések

<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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

Expert Bejegyzések: 297 Csatlakozás dátuma: 2008.01.03. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

New Member Bejegyzések: 21 Csatlakozás dátuma: 2015.04.09. Legújabb bejegyzések

<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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

Expert Bejegyzések: 297 Csatlakozás dátuma: 2008.01.03. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

New Member Bejegyzések: 21 Csatlakozás dátuma: 2015.04.09. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

Liferay Legend Bejegyzések: 1902 Csatlakozás dátuma: 2008.03.10. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

New Member Bejegyzések: 21 Csatlakozás dátuma: 2015.04.09. Legújabb bejegyzések
this method is auto generated by the lifery service builder.

IdentificationLocalServiceImpl.getIdentifications
thumbnail
Tina Agrawal, módosítva 8 év-val korábban

RE: show very large data in liferay search container

Expert Bejegyzések: 297 Csatlakozás dátuma: 2008.01.03. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: show very large data in liferay search container

New Member Bejegyzések: 21 Csatlakozás dátuma: 2015.04.09. Legújabb bejegyzések

<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, módosítva 7 év-val korábban

RE: show very large data in liferay search container

New Member Bejegyzések: 3 Csatlakozás dátuma: 2014.02.28. Legújabb bejegyzések
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, módosítva 7 év-val korábban

RE: show very large data in liferay search container

Junior Member Bejegyzések: 54 Csatlakozás dátuma: 2016.08.29. Legújabb bejegyzések
while finding the data give end and start as -1, -1