Monday, April 15, 2013

Anonymous Search Collection for custom Search Portlet



Introduction

The objective of the task is to create a Portal Search collection, which
could index contents inside specific site area of the WCM. As the client
has specific UI needs, Instead of out of box Search Portlet, the developer
is expected to access the Search services from the custom portal. All
contents thus searched from the custom Portlet should be searchable in
anonymous mode.


Steps to Create Collection


· Go to Administration > Manage Search >Search Collections > Default
Search Collection
· Click "New Collection"



· Click "ok"


Steps to Create Index


· Click "NCCollection"
· Click "New Content Source"
· Under "Content Source type" select "WCM site"
· Under "General Parameters"
o Content Source Name : DataIndex
o Collect documents linked from this URL :
http://hostname:10039/wps/seedlist/myserver?SeedlistId=NC_Contents/Data&Source=com.ibm.workplace.wcm.plugins.seedlist.retriever.WCMRetrieverFactory&Action=GetDocuments
o Stop fetching a document after (sec): 1800

· Under "Schedulers"
o From: Today's Date
o At: Current time
o Update every: 1 days
o Click Create
· Under "Security"
o User Name: wpsadmin
o Password: wpsadmin
o Host Name: hostname
o Click Create

· Click "Save"
· Click Play icon


· After some time click "Refresh" to see no of Documents indexed





Giving Anonymous Access to the Collection Resources



· Go to Administration > Access > Resource Permissions > PSE Sources
· Click on "Assign Access"





· Click on "Edit Role" against User



· Click Add
· Select "Anonymous Portal User"
· Click "ok"


Accessing the Collection Service using contenthandler servlet

It is possible to launch the search over the index thus created using
contenthandler servlet. Following is the example url which caries a query
text as "keyword".

http://hostname:10039/wps/contenthandler/searchfeed/search?queryLang=en&locale=en&resultLang=en&query=keyword&start=0&results=10&index=Default
+Search
+Service%3A%3AC%3A%5CIBM%5CWebSphere%5Cwp_profile%5CPortalServer%5Ccollections%5CDataIndex

For linux/unix based portal environments, the url would be of bellow format

http://hostname:10039/wps/contenthandler/searchfeed/search?queryLang=en&locale=en&resultLang=en&query=keyword&start=0&results=10&index=Default
+Search
+Service%3A%3A%2Fopt%2FIBM%2FWebSphere%2Fwp_profile%2FPortalServer%2Fcollections%2FDataIndex

The above URL could be launched from the custom Portlet and the response
would be in the form of ATOM feed. The developer could parse the ATOM Feed
and build the custom Portlet as per the UI needs given by customer.

No comments:

Post a Comment