掲示板

show very large data in liferay search container

8年前 に sanket jani によって更新されました。

show very large data in liferay search container

New Member 投稿: 21 参加年月日: 15/04/09 最新の投稿
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
8年前 に David H Nebinger によって更新されました。

RE: show very large data in liferay search container

Liferay Legend 投稿: 14914 参加年月日: 06/09/02 最新の投稿
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
8年前 に Ravi Kumar Gupta によって更新されました。

RE: show very large data in liferay search container

Liferay Legend 投稿: 1302 参加年月日: 09/06/24 最新の投稿
Try Pagination. emoticon
thumbnail
8年前 に Pankaj Kathiriya によって更新されました。

RE: show very large data in liferay search container

Liferay Master 投稿: 722 参加年月日: 10/08/05 最新の投稿
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.
8年前 に sanket jani によって更新されました。

RE: show very large data in liferay search container

New Member 投稿: 21 参加年月日: 15/04/09 最新の投稿
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
8年前 に Tina Agrawal によって更新されました。

RE: show very large data in liferay search container

Expert 投稿: 297 参加年月日: 08/01/03 最新の投稿
You are passing the start and end but are you also using them in the java classes to get only those many results?

Tina
8年前 に sanket jani によって更新されました。

RE: show very large data in liferay search container

New Member 投稿: 21 参加年月日: 15/04/09 最新の投稿
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
8年前 に Tina Agrawal によって更新されました。

RE: show very large data in liferay search container

Expert 投稿: 297 参加年月日: 08/01/03 最新の投稿
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
8年前 に sanket jani によって更新されました。

RE: show very large data in liferay search container

New Member 投稿: 21 参加年月日: 15/04/09 最新の投稿
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
8年前 に Pankaj Kathiriya によって更新されました。

RE: show very large data in liferay search container

Liferay Master 投稿: 722 参加年月日: 10/08/05 最新の投稿
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..
8年前 に sanket jani によって更新されました。

RE: show very large data in liferay search container

New Member 投稿: 21 参加年月日: 15/04/09 最新の投稿

<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
8年前 に Tina Agrawal によって更新されました。

RE: show very large data in liferay search container

Expert 投稿: 297 参加年月日: 08/01/03 最新の投稿
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
8年前 に sanket jani によって更新されました。

RE: show very large data in liferay search container

New Member 投稿: 21 参加年月日: 15/04/09 最新の投稿

<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
8年前 に Tina Agrawal によって更新されました。

RE: show very large data in liferay search container

Expert 投稿: 297 参加年月日: 08/01/03 最新の投稿
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
8年前 に sanket jani によって更新されました。

RE: show very large data in liferay search container

New Member 投稿: 21 参加年月日: 15/04/09 最新の投稿
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
8年前 に Samuel Kong によって更新されました。

RE: show very large data in liferay search container

Liferay Legend 投稿: 1902 参加年月日: 08/03/10 最新の投稿
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?
8年前 に sanket jani によって更新されました。

RE: show very large data in liferay search container

New Member 投稿: 21 参加年月日: 15/04/09 最新の投稿
this method is auto generated by the lifery service builder.

IdentificationLocalServiceImpl.getIdentifications
thumbnail
8年前 に Tina Agrawal によって更新されました。

RE: show very large data in liferay search container

Expert 投稿: 297 参加年月日: 08/01/03 最新の投稿
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
8年前 に sanket jani によって更新されました。

RE: show very large data in liferay search container

New Member 投稿: 21 参加年月日: 15/04/09 最新の投稿

<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..
7年前 に Jakub Rehak によって更新されました。

RE: show very large data in liferay search container

New Member 投稿: 3 参加年月日: 14/02/28 最新の投稿
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
7年前 に pramod kumara によって更新されました。

RE: show very large data in liferay search container

Junior Member 投稿: 54 参加年月日: 16/08/29 最新の投稿
while finding the data give end and start as -1, -1