掲示板

Improve "search" performance

9年前 に Ramakrishna C K によって更新されました。

Improve "search" performance

New Member 投稿: 3 参加年月日: 09/09/09 最新の投稿
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
9年前 に Juan Gonzalez によって更新されました。

RE: Improve "search" performance

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hi Ramakrisna.

thanks four you research. Please read the contribution guide for contributing them.
8年前 に Daniel Rodriguez によって更新されました。

RE: Improve "search" performance

New Member 投稿: 5 参加年月日: 15/03/03 最新の投稿
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.
6年前 に Jan Tošovský によって更新されました。

RE: Improve "search" performance

Liferay Master 投稿: 566 参加年月日: 10/07/22 最新の投稿
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