IT tutorials
 
Applications Server
 

SharePoint 2010 : Customizing Search Pages (part 2) - Advanced Search Pages

12/22/2012 11:02:33 AM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

3. Advanced Search Pages

The Advanced Search page contains the single Advanced Search Web Part shown in its default configuration in Figure 8.

Figure 8. Default advanced search Web Part


Although much of this Web Part can be customized easily in the property dialog box, three critical portions require modifying XML. The following information and illustrations will walk you through the properties to be modified as they appear. To edit the Advanced Search Web Part, first place the page in edit mode from either the Site Actions menu or the Page Ribbon. Then, to the upper right of the Web Part, choose Edit Web Part from the drop-down menu.

The first section of the Advanced Search Web Part is shown in Figure 9. These search box options enable the user to construct complex queries without knowing the appropriate query language structure. Each option includes a text label box and a selection to enable it.

Figure 9. The Advanced Search Web Part properties Search Box section


The Scope section, displayed in Figure 10, presents a series of query filters with check boxes and label text boxes. Although the Display Group used by the scope picker is configured within this section, both the Language and Result Type pickers are controlled by an XML section that will be discussed later.

Figure 10. The Advanced Search Web Part properties Scopes section


The Properties section, shown in Figure 11, manages query filters that use managed properties. An XML string contained in the Properties text box controls the managed properties available for use here, as well as the languages exposed in the language picker and the file types defined in the result type picker.

To edit this code, place the cursor in the text box to expose the Builder text editor blue button to the right of the text box. Because the file is a single line in this editor, you may want to copy the entire text to your favorite XML editor, make changes, and paste the modified text back into the Builder for saving to the Web Part properties.

Figure 11. The Advanced Search Web Part Properties section


The first section of the XML defines the languages supported by search. For each language definition (LangDef), the display name is shown within quotation marks and the assigned language ID is also shown within quotation marks. You do not need to modify this portion. Following is just a small portion of the code as an example.

<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<LangDefs>
  <LangDef DisplayName="Simplified Chinese" LangID="zh-cn" />
  <LangDef DisplayName="Traditional Chinese" LangID="zh-tw" />
  <LangDef DisplayName="English" LangID="en" />
  <LangDef DisplayName="Finnish" LangID="fi" />
  <LangDef DisplayName="French" LangID="fr" />
  <LangDef DisplayName="German" LangID="de" />
  <LangDef DisplayName="Italian" LangID="it" />
  <LangDef DisplayName="Japanese" LangID="ja" />
  <LangDef DisplayName="Spanish" LangID="es" />
</LangDefs>

The next section specifies the languages by LangID to be displayed in the language picker, as shown in the following code sample. To change the languages displayed, simply add or remove lines from these default settings and save the code back to the Properties text box.

<Languages>
  <Language LangRef="en" />
  <Language LangRef="fr" />
  <Language LangRef="de" />
  <Language LangRef="ja" />
  <Language LangRef="zh-cn" />
  <Language LangRef="es" />
  <Language LangRef="zh-tw" />
</Languages>

The next portion is the Property Definition section, as shown in the following code block. These properties must be managed properties. Additional property entries must include the real managed property name, the data type, and the name to display in the Web Part.

<PropertyDefs>
  <PropertyDef Name="Path" DataType="text" DisplayName="URL" />
  <PropertyDef Name="Size" DataType="integer" DisplayName="Size (bytes)" />
  <PropertyDef Name="Write" DataType="datetime" DisplayName="Last Modified Date" />
  <PropertyDef Name="FileName" DataType="text" DisplayName="Name" />
  <PropertyDef Name="Description" DataType="text" DisplayName="Description" />
  <PropertyDef Name="Title" DataType="text" DisplayName="Title" />
  <PropertyDef Name="Author" DataType="text" DisplayName="Author" />
  <PropertyDef Name="DocSubject" DataType="text" DisplayName="Subject" />
  <PropertyDef Name="DocKeywords" DataType="text" DisplayName="Keywords" />
  <PropertyDef Name="DocComments" DataType="text" DisplayName="Comments" />
  <PropertyDef Name="CreatedBy" DataType="text" DisplayName="Created By" />
  <PropertyDef Name="ModifiedBy" DataType="text" DisplayName="Last Modified By" />
  </PropertyDefs>

					  

You can add managed properties to these definitions even if they have not been designated for use in a scope. After they are defined, these properties can then be used in the result types filter definitions as well as the managed properties filters.

<ResultType DisplayName="Word Documents" Name="worddocuments">
  <KeywordQuery>FileExtension="doc" OR FileExtension="docx" OR
FileExtension="dot" OR FileExtension="docm" OR
ileExtension="odt"</KeywordQuery>
  <PropertyRef Name="Author" />
  <PropertyRef Name="DocComments" />
  <PropertyRef Name="Description" />
  <PropertyRef Name="DocKeywords" />
  <PropertyRef Name="FileName" />
  <PropertyRef Name="Size" />
  <PropertyRef Name="DocSubject" />
  <PropertyRef Name="Path" />
  <PropertyRef Name="Write" />
  <PropertyRef Name="CreatedBy" />
  <PropertyRef Name="ModifiedBy" />
  <PropertyRef Name="Title" />
  </ResultType>

There are result types for the following categories.

  • Default

  • Documents

  • Microsoft Word Documents

  • Microsoft Excel Documents

  • Presentations

You can enter new managed properties as property definitions, and then create new result types or modify existing ones in this file. After you edit the string, save it back into the Property text box.

The Miscellaneous section contains a single setting for the target results URL, as shown in Figure 12. In particular, a custom Advanced Query Web Part might need to point to a custom results page where the presentation of the results Web Parts has been modified to meet business needs. This custom results page can also contain non-search Web Parts that connect to the search Web Parts.

Figure 12. Advanced Search Web Part properties Miscellaneous section


A sample search query constructed by the advance search Web Part can be passed as the following.

ALL(searchterm) (DetectedLanguage="en") (IsDocument="True") Write>=02/01/2010

					  

A knowledgeable user can enter the search in a basic query box as the following and achieve the same results.

searchterm DetectedLanguage="en" IsDocument="True" Write>=02/01/2010

However, most users will find the UI of the advanced search easier to use.

 
Others
 
- SharePoint 2010 : Customizing Search Pages (part 1) - Query Pages, Search Box Web Part
- Microsoft Dynamic GP 2010 : Dynamics GP System - General Ledger Chart of Accounts, Master record IDs and names
- Microsoft Dynamic GP 2010 : Dynamics GP System - Companies in Dynamics GP, Integration with other systems
- Exchange Server 2010 : The Exchange Control Panel (ECP)
- Exchange Server 2010 : The Exchange Management Console
- Microsoft Lync Server 2010 : SQL 2008 R2 Backup and Restore
- Microsoft Lync Server 2010 : Installing SQL 2008 R2
- Microsoft Dynamics Sure Step 2010 : Quality Management and Optimization (part 2) - The Sure Step Optimization Offerings Roadmap
- Microsoft Dynamics Sure Step 2010 : Quality Management and Optimization (part 1) - Quality control within the project types
- Managing Exchange Server 2010 : The Exchange Management Shell (part 3) - Reporting with the Exchange Management Shell
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us