RE: Search Portlet: Page scope filter in forum search (Not filtered)

Bhavik Parmar, modified 6 Years ago. New Member Posts: 3 Join Date: 2/21/15 Recent Posts

Hi Team,

 

I have message board portlet (forums) added on two different private pages (belongs to same site).

One page (p1) has scope as default scope (i.e. current site scope) & another page (p2) has current page scope (newly created from portlet configuration)

 

I have added seach portlet on both the pages and I want to search only forum messages based on scope selected.

Also, while creating a new thread on two different pages are not same.

 

Now from index, scopeGroupId is the field which differentiates the messages based on scope.  (Site & page)

 

My requirement is to search forum messages based on the page user has opened. Message of p1 page should not be searched on page p2.

 

In LR 7.0, I am able to add my custom filter for scopeGroupId to search forum thread messages in FacetedSearcherImpl class (class was overriden)

 

But in LR 7.1, It is not the case. I cannot override same class as it is now not available to override.

So, records belong to only site scope is returned in both the pages.

Actually it should not display site forum messages to page p2 (page scope)

 

There are several contributors provided by Liferay in v7.1 to add those custom filter while search is performed. 

I have tried few of them like QueryPreFilterContributor class & ModelPreFilterContributor class for MBMessage, but didn't get any success.

 

Any other way to achieve this ?

 

- Bhavik

thumbnail
Nagendra Kumar Busam, modified 6 Years ago. Liferay Master Posts: 678 Join Date: 7/7/09 Recent Posts
can you add screen shots two pages to get more clarity
Bhavik Parmar, modified 6 Years ago. New Member Posts: 3 Join Date: 2/21/15 Recent Posts
Please find the attached images in main post
thumbnail
Nagendra Kumar Busam, modified 6 Years ago. Liferay Master Posts: 678 Join Date: 7/7/09 Recent Posts

 

You mentioned about you added, search portlet to both the pages. which one from the below list - do you mean search bar or the search under tools category?

Bhavik Parmar, modified 6 Years ago. New Member Posts: 3 Join Date: 2/21/15 Recent Posts
For search,  there is a custom module having just a textbox to search and then further search keywords are passed in url to search.jsp of SearchPortlet module with some custom parameters.