Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Deepjyoti Deepjyoti
content search
July 16, 2012 3:40 PM
Answer

Deepjyoti Deepjyoti

Rank: Junior Member

Posts: 80

Join Date: November 1, 2010

Recent Posts

Hi,
Is there an option to search a text (keyword) in only those webcontents of a site, which are linked to the portal pages of that site? I mean if there are webcontents which are not associated with a portal page, those webcontents will not be searched.
I am trying to use Liferay's search portlet in 6.1 version.

Thanks,
RK
Jignesh Vachhani
RE: content search
July 16, 2012 11:34 PM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 780

Join Date: March 10, 2008

Recent Posts

You can explore functionality of web content search portlet .
Its displaying search result only for those content which has been configured on that page.
Pinkesh Gandhi
RE: content search
July 18, 2012 6:09 AM
Answer

Pinkesh Gandhi

Rank: Regular Member

Posts: 100

Join Date: January 26, 2012

Recent Posts

Hi Rhina,

In Liferay Search Portlet, such kind of provision is already provided out of the box. There is one combobox available, just adjacent to the search text-box in search portlet, and in that combobox there are two options available (1) Everything (2) This Site.
So if you want the webcontents associated only with the current site, then before searching you need to select second option from the combobox that is "This Site" and then try to search.

Hope this will help you.
Bart Simpson
RE: content search
July 18, 2012 7:26 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

Yes, but it's limited to web content display portlet by using the web content search portlet and not the global one.
If you want to have that in global one, modify it with the query that is generated when search in 'web content search' portlet.

Add 'web content search' portlet and check it's configuration.
Deepjyoti Deepjyoti
RE: content search
July 18, 2012 2:56 PM
Answer

Deepjyoti Deepjyoti

Rank: Junior Member

Posts: 80

Join Date: November 1, 2010

Recent Posts

Ok. Thanks for all your replies. I think I should elaborate the requirement. Here is the requirement:

1. If I use Liferay's search portlet, it returns list of wecontents which have the keyword. I want the list of pages which have those webcontents associated with them.
2. I have a site containing multiple pages. Different pages have different webcontents associated with them. There are some permissions defined on the pages. e.g. Page1 is viweable by role1, page2 is viewable by role2 etc.
Now suppose a user "A" has role1. He logs into the portal and search for a keyword which is in a webcontent associated with Page2. Since User "A" doesn't have permission to view Page2, so the seach result should not return Page2.

Thanks for help!!!

RK
Hitoshi Ozawa
RE: content search
July 18, 2012 3:17 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

2. I have a site containing multiple pages. Different pages have different webcontents associated with them. There are some permissions defined on the pages. e.g. Page1 is viweable by role1, page2 is viewable by role2 etc.
Now suppose a user "A" has role1. He logs into the portal and search for a keyword which is in a webcontent associated with Page2. Since User "A" doesn't have permission to view Page2, so the seach result should not return Page2.


Should do this by default. If it doesn't, it's a bug.

1. If I use Liferay's search portlet, it returns list of wecontents which have the keyword. I want the list of pages which have those webcontents associated with them.


Do you have 1 web content per page? Links in the search portlet is to the web content instead of to a page. You'll have to modify liferay so it'll link to a page instead of to the web content. I've done this for my document system so the page will display with navigation bars.
Deepjyoti Deepjyoti
RE: content search
July 18, 2012 8:41 PM
Answer

Deepjyoti Deepjyoti

Rank: Junior Member

Posts: 80

Join Date: November 1, 2010

Recent Posts

Hi Hitoshi,

Thanks for your reply. In our site a webcontent is associated with only one page. So can you tell me which Liferay API should I use to get the pages(or link of pages) containing the resulting webcontents.

Thanks,
RK
Deepjyoti Deepjyoti
RE: content search
July 19, 2012 12:25 PM
Answer

Deepjyoti Deepjyoti

Rank: Junior Member

Posts: 80

Join Date: November 1, 2010

Recent Posts

Hi,

From a user's point of view, when he login into a site, on searching a keyword should return him links for pages (instead of webcontents), because a user doesn't know about webcontents. He only wants what are the pages which contain the keyword.

Thanks,
RK
Sayandip Ghosh
RE: content search
December 4, 2012 5:37 AM
Answer

Sayandip Ghosh

Rank: New Member

Posts: 11

Join Date: June 23, 2011

Recent Posts

Hi,

I guess it's quite a late reply for this thread. this can be achieved using a hook. Need to change inside main_search_result_form.jsp.

Sayandip.