Forums de discussion

Improve "search" performance

Ramakrishna C K, modifié il y a 9 années.

Improve "search" performance

New Member Publications: 3 Date d'inscription: 09/09/09 Publications récentes
Hi all,

This is relevant to 6.1 and 6.2 search

We have authored an Elasticsearch plugin for Liferay.
elasticray.com
https://www.liferay.com/marketplace/-/mp/application/41044606

During that process, we found some inefficiencies:

1. When searching for an asset with permissions, liferay modifies the "end" parameter in pagination to end + INDEX_FILTER_SEARCH_LIMIT (default value 5000),
2. This results in the engine returning almost all documents for the search term.
3. Liferay then loops through each result checking for permissions and then returning a subset based on pagination parameters

" File: https://github.com/liferay/liferay-portal/blob/6.2.x/portal-service/src/com/liferay/portal/kernel/search/BaseIndexer.java
....
Method: protected Hits filterSearch( "


Now while we are indexing the documents, we are indexing along with permissions:
https://github.com/liferay/liferay-portal/blob/6.2.x/portal-impl/src/com/liferay/portal/search/SearchPermissionCheckerImpl.java
addPermissionFields where roleId and groupRoleId are being set with the relevant values based on the asset permissions.

We just need to use this to retrieve only relevant results. We are surprised that this is not being done.

Search can become very efficient i.e. degree of 10-100 times faster if we do two things.

1. Pass the permission fields "roleId" and "groupRoleId" during retrieval to let the search engine return only the relevant results. (This has already been implemented in elasticray and we should be releasing this by Feb 27th - 2015)
2. Skip checking the permissions in the Liferay code in "BaseIndexer.java". (Wish to submit a patch)

This is the first time we are submitting a patch to Liferay source code. Whom do I contact to discuss the approach to our patch ?
thumbnail
Juan Gonzalez, modifié il y a 9 années.

RE: Improve "search" performance

Liferay Legend Publications: 3089 Date d'inscription: 28/10/08 Publications récentes
Hi Ramakrisna.

thanks four you research. Please read the contribution guide for contributing them.
Daniel Rodriguez, modifié il y a 8 années.

RE: Improve "search" performance

New Member Publications: 5 Date d'inscription: 03/03/15 Publications récentes
Hi everyone,

we are facing a problem that we think is related with the one described in this post, is there any place to get the patch to solve this problem or is it now integrated into a new version of Liferay (6.2 GA4 ?)?

Thanks in advance,

Daniel.
Jan Tošovský, modifié il y a 6 années.

RE: Improve "search" performance

Liferay Master Publications: 566 Date d'inscription: 22/07/10 Publications récentes
Hi Ramakrishna,

have your changes been integrated into LR code?

I can't see any related changes in 6.2.x branch. In 7.0 I can't even locate mentioned search related classes.

I observe same behavior like you - while retrieving search results from the index is fast, the most of time is spent when verifying permissions. The more results, the slower response.

I am still on 6.2 and found the response time is almost same even increasing the number of cores or available RAM.

In my search index there are approx 50k articles and 10k discussions (= 3 GB index).

Jan