Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Smilelws2010 lwz
Limiting the no of concurrent search or limiting search in porltet
October 18, 2012 7:44 AM
Answer

Smilelws2010 lwz

Rank: Regular Member

Posts: 160

Join Date: December 16, 2010

Recent Posts

HI

I have a custom portlet which query database and give back results. Now I would like to add some kind of limit to the search. Something like limit the total number of search happening a day? Could some one help me with the logic, even if it involves database. Or is it possible to limit the number of search per user a day using some session variable?

Please help.
Bart Simpson
RE: Limiting the no of concurrent search or limiting search in porltet
October 18, 2012 9:39 PM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

I wouldn't suggest maintaining it in session, as session is not such a reliable option, once the user logs out or comes back after session timeout new session will be created.
You can
  1. maintain a count in expando field of the user
  2. Hook search.jsp, and increment count of the logged in user
  3. clear each day may be through scheduled job or also maintain the date in expando
Smilelws2010 lwz
RE: Limiting the no of concurrent search or limiting search in porltet
January 10, 2013 12:03 PM
Answer

Smilelws2010 lwz

Rank: Regular Member

Posts: 160

Join Date: December 16, 2010

Recent Posts

Thanks Bart for the points. The particular requirement is a backlog item for the time being.

Bart is the above points all go in order or are they 3 different options?

Smile
Bart Simpson
RE: Limiting the no of concurrent search or limiting search in porltet
January 11, 2013 4:26 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

Sorry for the late reply, been really busy. The points are suggest is one solution and goes in order.