WCM Search Integration(配置站点搜索步骤)

WCM Search Integration


Overview
From WCM 6.0, the existing WCM search would be deprecated. WCM contents can be searched via integration between Web Content Management (WCM) and the Portal Search Engineer (PSE).

This document describes how to configure WCM search collection in Portal Search Administration and how to get a WCM site searchable through use of the search component..

This guide assumes you have setup WCM successfully and have a basic understanding on how to create a simple site.

Search Structure



Searching WCM Site
To Search a site, you must create a portal search collection first, then enable a site to be searchable.

1. Creating Portal Search Collection
Login portal server, and navigate to Administration > Search Administration > Manage Search > Search Collections.

A default WCM collection was created automatically during the installation of WCM there – WebContentCollection.

You can create your own search collection for your site, especially the site is a global web site and is not in English, you need to create a new search collection.

Create a new Collection:

 Location of Collection: NewWCMCollection  Enter a location of the new search collection (ensure that there are no spaces in the name)
 Name of Collection: NewWCMCollection  Enter the name of the new search collection (ensure that there are no spaces in the name)
 Specify Collection Language: English Choose the language for which the search collection and its index are optimized. The index uses this language to analyze the documents when indexing.
 Select Categories: None
 Select Summarizer: Automatic Choose whether a static summarizer is enabled for this search collection.
 Remove common words from queries: True Choose whether the indexer and the search filter out common words from documents, such as and, the, of.



2. Updating Site to be Searchable
Go to WCM authoring portlet , select library and navigate to Site Areas > By Site .

Select the site and click on “Edit”.

Enable the site to be searchable:

 Searchable: Checked Enable the site to be searchable
 Search Service: Default Portal Search Service  Select the search service  (If cluster, remote search service is required)
 Search Collection: NewWCMCollection  Select the name of search collection created in step 1.
 User ID: Admin Enter the valid user ID   指定爬虫的管理员
 Password: Admin Enter the valid user password我这要求的是匿名访问的用户可以搜索应该怎么设置?

Note: The content source created when a site is made searchable uses the credentials of the user entered here. Only items that the specified user has read access to or above will be included in the search. A manager or administrator may need to edit an existing site and enter their user name and password to enable all items in a site to be searchable

Save the changes of the site.

Then go to Administration > Search Administration > Manage Search > Search Collections, and click on name link of the collection NewWCMCollection , a new content source is available in the collection, wait for several minutes and click on refresh, you will see the contents in your site have been indexed correctly.


3. Creating a Search Form
3.1 Creating HTML component to display Search Query

A search query is created using an HTML element..

Go to WCM authoring portlet , select library and navigate to Components > HTML .

New a HTML component, input the name of the component, such as searchForm

Search Query Design Example:

In this example, three fields have been added allowing users to search content title , author name and the body of the content:

<form action='<PathCmpnt type="servlet" />/library/site/sitearea/content' method="post">

<table>
    <tr>
        <td>Content Title</td>
        <td><input type="text" name="search_title"/></td>
    </tr>
    <tr>
        <td>Author's Name</td>
        <td><input type="text" name="search_authors"/></td>
    </tr>
    <tr>
        <td>Content Body</td>
        <td>
        <input type="text" name="search_query"/>
    </td></tr>
        <tr><td align="right">
        <input type="submit" value="Search"/>
    </td></tr>
</table>

</form>


Search Parameters:

The following parameters can be used in a search query in this format:

<input name="search_parameter" />

search_query Used to search the content of any elements stored in a content item.
search_authoringtemplate Used to search the authoring template, if available, that was used to create the content item.
search_authors Used to search the name or names of the authors for the content item, if any are defined.
Note: Searching for LDAP users
When searching for LDAP users, the full distinguished name must be submitted. Users will be unaware of what the actual distinguished name of a user will be. It is recommended that if planning to allow users to search for authors, you should create a predefined list or dropdown to allow users to select a known author. That way the user names can be displayed in a user-friendly manner, but the input submitted by the form can be the distinguished name for the selected user.
search_categories Used to search the categories of the content item if any are defined. //这个是指定了内容的分类,如调动动态
search_description Used to search the description of the content item.
search_effectivedate Used to search the effective date of the content item.
Note: Search by date only works with the format MMM dd yyyy HH:mm:ss z. For example, Sep 20 2006. To change the format, you will need to edit the SearchService.DateFormatString parameter in the SearchService.properties file.
search_expirationdate Used to search the expiration date of the content item.
Note: Search by date only works with the format MMM dd yyyy HH:mm:ss z. For example, Sep 20 2006. To change the format, you will need to edit the SearchService.DateFormatString parameter in the SearchService.properties file.
search_keywords Used to search the keywords of the content item if any are defined.
search_lastmodifieddate Used to search the last modified date of the content item.
Note: Search by date only works with the format MMM dd yyyy HH:mm:ss z. For example, Sep 20 2006. To change the format, you will need to edit the SearchService.DateFormatString parameter in the SearchService.properties file.
search_modifier Used to search the name of the last person to modify the content item.
search_name Used to search the name of the content item.
search_owners Used to search the name or names of the owners of the content item, if any are defined.
Note: Searching for LDAP users
When searching for LDAP users, the full distinguished name must be submitted. Users will be unaware of what the actual distinguished name of a user will be. It is recommended that if planning to allow users to search for authors, you should create a predefined list or dropdown to allow users to select a known author. That way the user names can be displayed in a user-friendly manner, but the input submitted by the form can be the distinguished name for the selected user.
search_title Used to search the title of the content item
怎么和wcm内容模板的做对应的问题?按标题搜索,和内容模板的标题做对应?
3.2 Creating Search Component to display search result

Go to WCM authoring portlet , select library and navigate to Components > Search .

New a search component, input the name of the component, such as searchCmpnt

Search Element:

 Search Service: Default Portal Search Service  Select the search service  (If cluster, remote search service is required)
 Search Collection: NewWCMCollection  Select the name of search collection created in step 1.
 Result per page: 10 Enter the number of results to display per page
 Start page:1 Select the page to display when first rendered
 Maximum pages to include:10 Enter the maximum number of pages to display
 Pages to read ahead:10 Enter the number of results pages to read ahead when using a page navigation element. For example, if you enter 3, the page navigation element will calculate results up to 3 pages ahead of the current page. Increasing this number will improve the accuracy of the page navigation element. Lowering this number will improve the performance of the page navigation element when rendered.

Note: To display multiple pages, you will need to use a page navigation element. This is referenced within the header or footer of the search element design specified below.

 Sort results by : Relevance Select how the search results should be sorted.

Search Element Design:

In this example, a table is used to layout the search results.

Header <table>
Result
The attributes to display in each search result are defined here. <tr><td>
    <attributeResource attributeName="namelink"/><br>
    <attributeResource attributeName="summary"/>
</td></tr>
// attributeName是指定的内容模板的字段吗?
Separator
A separator can be used to delineate each search result. <tr> <td  bgcolor="#FFFAA" colspan="2"/>  </tr>
Footer
A page navigation element stored in a component is referenced here to add page navigation to the search results.     <tr><td>
        <component name="pagenavigationcomponent"/>
wcm的分页组件
    </td></tr>
</table>
No results There are no results for your query. Please refine your search and try again.

Search Element Parameters:

The following parameters can be used to display data in a search result design using an attribute resource tag:

<attributeResource attributeName="parameter" separator=" " format=" "/>

attributeName=authoringtemplate The name of the authoring template, if available, that was used to create the content item.
attributeName=author The name or names of the authors of the content item, if any are defined. If there is more than one author, then they will be rendered with the string specified in the optional separator attribute between each value.
attributeName=category The categories of the content item if any are defined. If there is more than one category, then they will be rendered with the string specified in the optional separator attribute between each value.
attributeName=contentid The id of the content item.
attributeName=contentpath The path excluding the server address, port or servlet context (/wps/wcm) for this search result.
attributeName=date The value of the date field from the SIAPI result. The format of the date can be specified by using the optional format attribute. See the Javadoc HTML documentation for SimpleDateFormat in the Java SDK for details.
attributeName=description The description of the content item.
attributeName=effectivedate The effective date of the content item. The format of the date can be specified by using the optional format attribute. See the Javadoc HTML documentation for SimpleDateFormat in the Java SDK for details.
attributeName=expirationdate The expiration date of the content item. The format of the date can be specified by using the optional format attribute. See the Javadoc HTML documentation for SimpleDateFormat in the Java SDK for details.
attributeName=keywords The keywords of the content item if any are defined. If there is more than one keyword, then they will be rendered with the string specified in the optional separator attribute between each value.
attributeName=lastmodifieddate The last modified date of the content item. The format of the date can be specified by using the optional format attribute. See the Javadoc HTML documentation for SimpleDateFormat in the Java SDK for details.
attributeName=modifier The name of the last person to modify the content item.
attributeName=name The name of the content item.
attributeName=namelink This assembles a complete link based on the name of the item being returned.
attributeName=owner The name or names of the owners of the content item, if any are defined. If there is more than one author, then they will be rendered with the string specified in the optional separator attribute between each value.
attributeName=parentcontentpath This is used to return the content path excluding the server address, port or Servlet context for the parent content item of this search result. For example: /wps/wcm
This parameter is valid when the search results include a link to a file resource element in the parent content item and is used to give context to the attached file. When the search result is not for an attached file in a file resource element, this value will be an empty string.
attributeName=relevance The relevance “score” for this search result from the search engine.
attributeName=summary The summary of the content item as generated by Portal Search.
attributeName=title This is the title of a content item.
attributeName=titlelink This assembles a complete link based on the title of the item being returned.
attributeName=url Displays the URL of a content item.
separator=" " Enter text or code to be used to separate multiple search results. For example: separator=" - "
format=" " The format of date parameters can be set using this parameter. See the Javadoc HTML documentation for SimpleDateFormat in the Java SDK for details.

3.3 Creating a content to search content

Create a content in WCM and update the presentation of the content to add the search form in. Following tags should be put into the presentation template to reference the HTML component and search component you have created..

<component Name=”searchForm”/>
<component Name=”searchCmpnt”/> 
这个是不是把这个代码加在搜索组件里面?用wcm建立一个显示模板,把这个代码放在显示模板里面
<component Name=” shenhuasearchform”/>  
<component Name=” shenhua_site_search_zujian”/>

Modify the design of searchForm to change the action URL of the form to be the content you’ve created.

<form action='<PathCmpnt type="servlet" />/library/site/sitearea/content' method="post">

3.4 Previewing the search content

Preview the content, you can search it now.


Search and Browse
Go to Administration > Portlet Management > Portlets;

Find the Search and Browse portlets and make a copy of the portlet, call it Search and Browse WCM.
是那个portal?是搜索中心吗?
Click on the Configure icon of the portlet, find the CollectionLocation parameter and modify  it to be the value of collection location created above:

CollectionLocation: C:\IBM\WebSphere\PortalServer\collections\NewWCMCollection

Note: You will fing this value in Search Administration> Manage Search > search collections , select WCMCollection under the Collection Status see Collection Location

Add the Search and Browse WCM portlet to a new page, then you can use this page to do the search of WCM.



Search Center
You can use the Search Center to search for Web content by adding a WCM search collection to the Search Center.

Go to Administration > Search Administration > Manage Search> Search Scopes.

Click New Scope.

Click Select Locations and select your Web Content Management search collection NewWCMCollection.

Complete the search scope and click OK.




累了,去 读意优休息一下下,QQ空间,美文,非主流,网络日记,搞笑短信,祝福短信,热门短信,有意思啊

你可能感兴趣的:(html,Web,qq,配置管理,Go)