Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
major major
Make web content searchable
February 18, 2013 5:40 AM
Answer

major major

Rank: New Member

Posts: 13

Join Date: November 1, 2012

Recent Posts

How do I make a web content searchable?
Subhash Pavuskar
RE: Make web content searchable
February 18, 2013 8:53 AM
Answer

Subhash Pavuskar

Rank: Regular Member

Posts: 234

Join Date: March 12, 2012

Recent Posts

Hi,

To add search in theme:

1. Open file [LIFRAY_SDK]/themes/{theme-name}/docroot/_diffs/templates/portal_normal.vm

2. Add $theme.search() at your desired location.

3. Build and deploy the theme.

4. A search text box will appear where the code was placed


To Customize the search:

1. Open file [LIFERAY_HOME]/tomcat-6.0.26/webapps/ROOT/WEB-INF/classes/portal-ext.properties

2. Add following lines:

com.liferay.portlet.blogs.util.BlogsOpenSearchImpl=true

com.liferay.portlet.bookmarks.util.BookmarksOpenSearchImpl=true

com.liferay.portlet.calendar.util.CalendarOpenSearchImpl=true

com.liferay.portlet.directory.util.DirectoryOpenSearchImpl=true

com.liferay.portlet.documentlibrary.util.DLOpenSearchImpl=true

com.liferay.portlet.imagegallery.util.IGOpenSearchImpl=true

com.liferay.portlet.journal.util.JournalOpenSearchImpl=true

com.liferay.portlet.messageboards.util.MBOpenSearchImpl=true

com.liferay.portlet.wiki.util.WikiOpenSearchImpl=true

3. Change values to “false” for those you do not want to include in search result.

For example, to search only “Web Content”, leave “com.liferay.portlet.journal.util.JournalOpenSearchImpl” to “true” and make other values to false.
major major
RE: Make web content searchable
February 19, 2013 1:03 AM
Answer

major major

Rank: New Member

Posts: 13

Join Date: November 1, 2012

Recent Posts

thanks Subhash.
1. I would like to know how to choose which parts of the content in the web content will be searchable?
I guess I need to do the following:
A. In a web content edit screen there is a field which name is:"Tags"
B. In a structure edit screen there is a select box for each field which has values: Searchable - Keyword , Searchable - Text
Is there additional settings to config?

2. Does the search query support AND, OR ,NOT, special characters?
Dhvanil Reshamwala
RE: Make web content searchable
February 19, 2013 3:57 AM
Answer

Dhvanil Reshamwala

Rank: New Member

Posts: 13

Join Date: December 23, 2011

Recent Posts

Hi,
By default web content is searchable. You will not require to do any setting in portal-ext.properties.

1) All the fields marked as searchable in the structure can be searched. Tag search will display the webcontent is user searches that particular tag contents.
2) Internally Liferay uses Lucene to search for the items. So you should be able to use AND, OR and other items as per Lucene syntax.

Thanks,
Dhvanil
Jaynil A Bagdai
RE: Make web content searchable
February 23, 2013 5:45 AM
Answer

Jaynil A Bagdai

Rank: Regular Member

Posts: 119

Join Date: March 3, 2012

Recent Posts

Hi Major,

When you create web content, you will see a checkbox over there named "Searchable", if you select that it will automatically become searchable no extra configurations needed.