advertisement

Overview

The Search User Item is a Content Item that creates a search form on a custom Page. The form provides input fields visitors can use to search for people on the site. The form uses a script that executes in the visitor's browser and does not depend on any remote server, so it will work with sites published on the web and sites published on removable media.

The search facility uses a data index that GedSite creates when it makes the site. The Search User Item includes properties to define the contents of that data index. You can manage the size of the data index by adjusting those properties. For users whose sites include more than 10,000 people, you may find it necessary to eliminate some of the data in the index to ensure that the browser is able to load the data index file.

The search facility is designed for sites with 15,000 people or less. On larger sites, the data index may be too large for the browser to load, and the search form will not operate properly as a result. However, circumstances vary based on the exact content of your site, and even if you have more than 15,000 people, you should test the feature to see if it works for you. Sites with 75,000 or more people are using the search facility.

The Search facility relies on Javascript. If a visitor has Javascript disabled, the Search form will not appear on the page.

Properties

The Edit Search Item window controls the properties associated with a Search User Item including the configuration of the search form and the contents of the data index.

Title

Enter a title for the user Item. The title is not displayed as part of the search form, but the User Item must have a title to identify it in the list of User Items.

Enabled

The Enabled checkbox controls whether or not the User Item is processed when GedSite is making the site.

Max Pages

The search results are split into sets called pages. The Max Pages property controls the maximum number of result pages. The choices are 1, 5, and 10, and the default is 5.

Items per Page

The search results are split into sets called pages. The Items per Page property controls the maximum number of results on a single result page. The choices are 10, 25, and 50, and the default is 25.

The maximum number of results that can be shown is determined by multiplying Max Pages times Items per Page.

Method

The Method pull-down menu controls the default text comparison method used by the search script, Basic or Regular Expression. Both methods treat upper- and lower-case characters the same, so "a" will match "A" and vice-versa. The two methods use different wildcard symbols. See the Search Methods section below.

Show RegEx Checkbox

The The Show RegEx Checkbox property controls whether or not the end-user can switch between the Basic and Regular Expressions search methods. When checked, a checkbox will appear on the search form and the user may check it to use a Regular Expression, or clear it to use the Basic method.

Search Methods

This section explains how the Basic search method differs from the Regular Expression search method.

On this help page, search terms are called patterns and appear like this. Data values are shown as quoted strings, "like this".

Basic Method

The Basic method uses two wildcard symbols, ? and *. ? matches any single character, and * matches any string of characters. The given pattern must match at word boundaries in the associated data field. So, for example, the pattern wood will match a surname of "Wood", but not "Atwood" or "Woodbury". The pattern wood* will match "Wood" or "Woodbury", but not "Atwood". The pattern *wood* will match "Atwood", "Wood", and "Woodbury".

Basic Method Symbols

SymbolFunction
? Matches any single character

Sm?th matches "Smith" and "Smyth".

* Matches any string of characters.

Wood* matches "Wood" and "Woodbury".

Regular Expressions Method

The Regular Expressions method supports powerful text matching capabilities using a set of special characters to describe matching rules. By default, text fields on the search form are "contains" patterns, so a search for wood will match "Atwood", "Wood", "Woodbury", and more. You can make more restrictive patterns using the special characters shown in the table below.

Regular Expression Method Symbols

The following characters have a special meaning when the Search Method is set to Regular Expressions.

SymbolFunction
. Matches any character.

sm.th matches "Smith" and "Smyth".

* Matches zero or more occurrences of the previous character or term.

millett* matches "Millet" and "Millett".

.* Combining the two symbols above matches zero or more occurrences of any character.

mill.* matches "Millet", "Millett", "Miller", and more.

^ Matches the start of a field.

^a matches the first "A" in "Anita".

$ Matches the end of a field.

a$ matches the last "a" in "Anita".

\b Matches any word boundary

\bwill matches "Will" in "Charles William" and "William Charles".

[abc...] Matches any character specified between the brackets.

sm[iy]th matches "Smith" and "Smyth". You may also use ranges, i.e., "[0-9]".

(a|b|...) Matches one of a set of alternatives.

(bill|william) matches "Bill" and "William". (bill|will)* matches "Bill", "Billie", "Billy", "Will", "Willy" and "William".

The Example Help Text below describes some of the Special Characters available in Regular Expressions.

Help Text

If you wish to include text that explains how to use the search form, include the text and HTML in the Help Text property. When Help Text is present, a question mark icon appears on the form. Clicking the icon opens the help text in a pop-up panel. Example help text is shown below. You have my permission to copy this text, and amend it if desired, for use on your own web site. No attribution is required or expected.

Example Help Text

<p>This Search form supports two search methods, <strong>Basic</strong> and <strong>Regular Expressions</strong>.</p>

<h2>Basic</h2>

<p>The Basic method supports two wildcard characters, "<code>?</code>" and "<code>*</code>". The "<code>?</code>" character matches any single character, and "<code>*</code>" matches any string of characters. The given pattern must match at word boundaries in the associated data field. So, for example, the pattern "<code>wood</code>" will match a surname of "Wood", but not "Atwood" or "Woodbury". The pattern "<code>wood*</code>" will match "Wood" or "Woodbury", but not "Atwood". The pattern "<code>*wood*</code>" will match "Atwood", "Wood", and "Woodbury".</p>

<h2>Regular Expressions</h2>

<p>Regular Expressions are powerful text matching facilities that use a set of special characters to describe matching rules. By default, text fields on the search form are "contains" filters, so a search for "<code>wood</code>" will match "Atwood", "Wood", "Woodbury", and more. You can make more restrictive filters by using pattern matching characters. "<code>^</code>" matches the beginning of the field, so to specify that a surname value must begin with "wood", enter "<code>^wood</code>". "<code>$</code>" matches the end of the field, so to specify that a surname value must end with "wood", enter "<code>wood$</code>".</p>

<p>You can use other pattern matching characters in the name fields.</p>

<ol>

<li>A period ("<code>.</code>") matches any character, so a search for "<code>mill.t</code>" matches "Millet" and "Millit".</li>

<li>A plus sign ("<code>+</code>") indicates that the last character may occur one or more times, so "<code>mil+et</code>" matches "Milet" and "Millet".</li>

<li>An asterisk ("<code>*</code>") indicates that the last character may occur zero or more times, so "<code>millet*</code>" matches "Millet" and "Millett".</li>

<li>Brackets indicate alternative characters, so "<code>mille[nr]</code>" matches "Millen" and "Miller".</li>

<li>Parentheses indicate alternate terms, so "<code>(bill|william)</code>" matches "Bill" and "William".</li>

</ol>

On This Page

See also: