Working with the Search Feature


There are multiple ways in which you can interact with and manage searches in SharePoint 2007. The following sections discuss the two most common search interfaces:

  • Basic Search:   The most common search query where users type simple keywords and phrases that the search uses to find file content, file names and properties.

  • Advanced Search:   Amore detailed search that filters based on properties, file types, and languages. It includes options for how the keywords relate to the search query - for example, if it should search in the order a user enters a phrase or if any of the words should appear.

This section discusses both search interfaces and provides some hands-on experience using both.

Using the Basic Search

Every site in SharePoint has a basic search box in the top-right corner, as shown in Figure 14-1, where users can enter terms or words that allow them to find content. SharePoint searches the titles and column data associated with documents as well as the document itself. Depending on your file format, your administrator may need to install an iFilter, which was discussed in the previous section.

image from book
Figure 14-1

To the left of the search box is a drop-down box where you can define a scope for your search. This box has a default scope list that is site-specific and changes depending on where you search for something. For example, by default the drop-down box on a team or portal site home page has the options All Sites, People, and This Site. However, the drop-down box from a View page of a document library or list has the options just mentioned as well as This List: List Name. The following shows the common scope of options for a basic search:

  • All Sites:   Searches all sites and content sources in the SharePoint index.

  • People:   Searches against user profile properties. This is the same scope that the Employee Finder Web Part uses. For more on Web Parts, see Chapter 7.

  • This Site:   Searches for results on the current site only.

You learn how to manage additional scopes later in this chapter in the section “Create Search Scopes.” First, you need to become familiar with using the basic search functionality from the perspective of an end user.

Tip 

To ensure that searches reflect information that should already exist in your environment, you perform searches in this chapter for content created in previous examples in this book. If you no longer have these documents or have not completed all the chapter exercises, use your own search terms to reflect information you know exists in your environment.

Try It Out-Perform a Basic Search for Content

image from book

In this example, you perform two basic searches using the words Advertising Materials. For the first search, you type the two words without any quotation marks or special characters. This returns a list of items that show where the words appear together and separately, but in no specific order. For the second search, you place the two words in quotation marks. This limits the results that only show the words together and in the order specified.

  1. From the home page of your SharePoint site, enter the words Advertising Materials in your search box, as shown in Figure 14-2.

    image from book
    Figure 14-2

  2. Click the Search icon to the right of the search box.

  3. Select the View by Modified Date option. Notice the number identified for your search results, as shown in Figure 14-3.

    image from book
    Figure 14-3

  4. In the search box, place quotation marks around the words Advertising Materials.

  5. Press Enter. Notice the number identified for your search results this time, which are shown in Figure 14-4.

    image from book
    Figure 14-4

How It Works

For both searches, you see a list of items in order of relevance that contain the words you have entered, with the words appearing in bolded text. For the first search, all occurrences of the words appear. Selecting the View by Modified Date option in step 3 changes the order so that the most recent item appears first in the list. This is important because for editing purposes, you may need the most up-to-date document instead of the most relevant. For the second search, you have fewer results because the search only lists occurrences when the two words appear together.

image from book

Using the Advanced Search

Using quotation marks or changing the result sort order may not be enough when you’re typing vague or highly used words. This is especially true if your SharePoint environment has numerous documents - a situation that always yields a large number of results. However, you can refine your search using the Advanced Search feature. Besides being able to type exact phrases for your search criteria, you can specify the type of document you’re searching for in the Result Type field (seen in 14-5).

image from book
Figure 14-5

When you type something in the Created By field, SharePoint searches through specific column data in document libraries. By default, SharePoint offers the following properties as options:

  • Author

  • Description

  • Name

  • Size

  • URL

  • Created Date

  • Last Modified Date

  • Created By

  • Last Modified By

In addition to these properties, you can create your own properties. This is helpful for locating items in specific columns that are used as properties for multiple lists, libraries, or content types throughout the environment.

In the following exercises, you see the process for promoting these properties to the Advanced Search interface as well as how to work with the Advanced Search feature. In the first Try It Out, you perform an advanced search and then sort for the most recent document. The second Try It Out simulates a scenario where the users must search for documents and content based on the client for which the document was created. This means you need to associate the information with content, which requires a site column as well a central listing of clients that the site column can reference.

Try It Out-Perform an Advanced Search for Content

image from book

In this example, you want to find a Word document you created that contains the exact phrase from an advertising campaign for Newfoundland and Labrador. You cannot remember the name or the location of the document, so you use the Advanced Search feature to define what you know about the document and thus increase your odds of finding it.

  1. From the main page of your portal page, click the Advanced Search link to the right of your search box. You are redirected to a page in the Search Center with an interface where you can define search details, as was shown in Figure 14-5.

  2. Enter the following into the available fields:

    Open table as spreadsheet

    Field

    Value

    The Exact Phrase

    Experience the thrill of Newfoundland and Labrador.

    Result Type

    Word documents.

    Created By

    Enter your own first name.

  3. Click the Search button.

How It Works

By typing the phrase Experience the thrill of Newfoundland and Labrador in the box for exact phrase, you eliminated results that contain documents with similar words, such as those that have Newfoundland and Labrador. However, to further refine your search, you limit the results to include only Word documents that you created.

Tip 

To ensure that the experience will be the same for all readers of this book, the next exercise starts by creating a custom property and assigning it to a document library. You then complete the process of mapping the managed property to a crawled property. In order to complete this process, you will require access to the SharePoint Search Administration page as part of the Shared Services admin. If you do not have access to this area, you will have to see your server farm administrator.

image from book

Try It Out-Create a Managed Property

image from book

In this example, a property in a site column becomes available to users on an Advanced Search page when you make it a managed property. You first create a site column that references a clients list. This allows site managers to add that column to document libraries, lists, and content types throughout the site collection so they can track content related to specific clients. To validate your configuration, you add test data to the central list and then add the site column to a document library. You can then associate column values with a couple of sample documents so that they can later be returned in your search results when you perform a search using that property.

Next, you start an Incremental Crawl of the SharePoint environment, which searches for any differences in the system since the last crawl. It identifies the new property associated with your sample documents and adds it to a special list called Crawled Properties.

You then go into the Shared Services Administration site of your SharePoint environment to create and define a new managed property. This is the item you will reference from the Advanced Search interface later in the exercise. You add a mapping to the crawled property that you discover during your incremental update related to the client’s site column. SharePoint groups all crawled properties based on how they were discovered, and therefore this column was automatically associated with the SharePoint group. More than one crawled property may be associated with a single managed property, if desired.

  1. From the home page of the top-level site in your site collection, select View All Site Content.

  2. Click the Create button from the toolbar.

  3. Select Custom List from the Custom Lists group.

  4. Enter Clients for the name and the following for a description:

    Important 

    This is a central listing of all clients that will be referenced by content stored within this system.

  5. Select No to Display the List on the Quick Launch bar.

  6. Click the Create button. Your clients list is created and you are redirected to it.

  7. Add two new items to the clients list called Client A and Client B using the methods described in Chapter 2. These entries will serve as sample data to simulate items that you might have in a real client listing.

  8. Select Site Actions image from book Site Settings. If you are on a publishing site, you may need to select Site Settings image from book Modify All Site Settings.

  9. Select Site Columns.

  10. Click the Create button from the toolbar. The Create Column window appears, as shown in Figure 14-6.

    image from book
    Figure 14-6

  11. For Column Name, enter Clients and select Lookup (information already on this site) for the Column Type.

  12. Select New Group and enter Global Properties.

  1. For Description, enter the following:

    Important 

    Central column to be used to associate a client with a document or list item. This column refers to the master clients list.

  2. Select to Get Information from Clients and from the Title Column.

  3. Click the OK button.

  4. Return to the home page of your top-level site.

  5. Click the View All Site Content link.

  6. Select the Documents library.

  7. Add the Clients site column to the library using the method described in Chapter 6.

  8. Upload two documents to the library and associate Client Awith one and Client B with the other.

  9. Go to the Shared Services Administration site of your SharePoint environment. If you do not know the exact URL of this site, please see your SharePoint farm administrator.

    Tip 

    This site is also linked from the Central Administration site under the Shared Services Administration heading in the left-hand navigation. The exact name of this link may depend on your system’s configuration. If you do not have access to this site, you will need to obtain it to complete this exercise.

  10. Select Search Settings from the Search group.

  1. Select Content Sources and Crawl Schedules.

  2. Hover your cursor over the Local Office SharePoint Server Sites and select Start Incremental Crawl, as shown in Figure 14-7. Depending on how much content exists on your server, the incremental process may take a while. You should wait for this process to complete before moving ahead to step 29.

    image from book
    Figure 14-7

  3. Select Search Settings from the breadcrumb trail.

  4. Click the Metadata Property Mappings link, as shown in Figure 14-8.

    image from book
    Figure 14-8

  1. Click New Managed Property.

  2. Enter the following for the property details:

    Open table as spreadsheet

    Field

    Value

    Property Name

    Clients.

    Description

    Allows for searching based on a property of a client name.

    The Type of Information in This Property

    Text.

    Mappings to Crawled Properties

    Include values from all crawled properties mapped.

  3. Click the Add Mapping button.

  4. Select SharePoint for the category.

  5. Type the word Clients in the Crawled Property name box and click the Find button.

  6. Select the returned property of ows_Clients(Text) as shown in Figure 14-9.

    image from book
    Figure 14-9

  1. Click the OK button.

  2. Select the check box to allow the property to be used in scopes.

  3. Click the OK button.

How It Works

Now that you’ve created a managed property, you add it to the Advanced Search Web Part so that your team can access it when performing an advanced search.

image from book

Try It Out-Add a Managed Property to Advanced Search Web Part

image from book

You now add your managed property to the properties associated with the Advanced Search Web Part from the Advanced Search page. The first reference you add defines the property so that when a user selects a check box associated with the client property, the appropriate managed property is searched. The second reference ensures that the results associated with that property displays in the All Results page. Once you finish configuring everything, you rebuild the SharePoint Sites index to ensure that your documents appear in the search results when you perform a test search.

  1. Return to the main page of your intranet site.

  2. Click the Advanced Search link to the right of the search box.

  3. Select Site Actions image from book Edit Page.

  4. Select Edit image from book Modify Shared Web Part from the Advanced Search Box Web Part.

  5. Expand the Properties category.

  6. Select the Properties text box and click the Expansion button to the right.

  7. Locate the <PropertyDefs> tag in the listing box.

  8. Place the following line after the PropertyDefs tag:

      <PropertyDef Name="Clients" DataType="text" DisplayName="Client"/> 

  9. Locate the following line in the listing box:

      <ResultTypes><ResultType DisplayName="All Results" Name="default"><Query/> 

  10. Place the following line after the <Query/> tag.

      <PropertyRef Name="Clients" /> 

  11. Click the OK button.

  12. Click the Apply and OK buttons on the Web Part.

  13. Click the Publish button from the Page Editing toolbar to publish your page as described in Chapter 13.

  14. Return to the Shared Services Administration site of your SharePoint environment. Select Search Settings from the Search group.

  1. Select Content Sources and Crawl Schedules.

  2. Hover your cursor over the Local Office SharePoint Server Sites and select Start Full Crawl, as shown in Figure 14-10.

    image from book
    Figure 14-10

How It Works

When you conduct a new search, you can now visit the Advanced Search interface and select Clients from the Property drop-down list, enter Client A as shown in Figure 14-11, and click the Search button.

image from book
Figure 14-11

image from book

You should receive a result that matches the document you uploaded to the document library and specified a value of “Client A” for the Clients site column. Also notice that the list item Client Afrom the Clients list does not get returned as a result. This is because you have defined the search to be items that specifically have the value Client Aas a value for Client.




Beginning SharePoint 2007. Building Team Solutions with MOSS 2007
Beginning SharePoint 2007: Building Team Solutions with MOSS 2007 (Programmer to Programmer)
ISBN: 0470124490
EAN: 2147483647
Year: 2007
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net