# Simple Searches

To conduct a quick search within the current Bible or commentary module, the Search Bar in the Sidebar should usually be adequate. Click either in the menu bar Edit Search or in the Sidebar Modules Search to access it.

## The Search Bar

The Search Bar

The Search Dialog consists of the following parts:

- Search Key Entry box

- Search Module Selector

- Search Type Selector

- Search Options Checkbox

- Search Scope Selector

- Search Results View

## Search Key Entry Box

Allows entry of the key for which you would like to search. The search key can be a word, part of a word, several words, a phrase, or a regular expression depending on the type of search selected. When the search key is entered and all other selections in the search dialog are complete, click the Find button to begin the search.

This search uses the optimized search method (see next section) if the module has previously been indexed, and will use AND semantics by default (matched verses contain all words you entered).

## Search Module Selector

Allows selection of which modules you would like to search. Select Bible to search Bible versions or Commentary to search commentaries. Only the currently active module will be searched.

## Search Type Selector

Allows selection of the type of search. There are three search types available:

Multi word

  This type will match any verse that has all the words in the search key, regardless of where they appear in the verse. By default, "lucene" fast search will be used, with fallback to the slower plain version of multi-word search in the absence of an index.

Regular expression

  This search uses a regular expression as a search key. A regular expression is a pattern used to match a string of text. A regular expression can be used to find verses with words that match a particular pattern. For example the regular expression `[a-z]*iah` will match verses that contain the words Aiah, Ahaziah, Athaliah and Amariah.

  A complete discussion of regular expressions is beyond the scope of this manual, but more information can be found in the grep man page.

Exact phrase

  This type will match the search key exatly as entered. If the search key is `it is good`, this search would match a verse which contains "it is good," but would not match a verse which contains " good, and doeth it not, to him it is sin."

## Search Options Checkbox

Allows selecting of search options. The only available option is Match case. Check this box to make the search case sensitive.

## Search Scope Selector

Allows defining the range within the specificed module that will be searched. There are three search scopes available:

No scope

  This button causes the search to to include the entire module.

Use bounds

  Selecting this button produces two dropdown selector boxes marked Lower and Upper. Select the first book to search in the Lower box and the last book to search in the Upper box. The search will begin with the Lower book and end with the Upper book and include all books in between.

  Chapter and verse numbers can be entered into the search bound boxes as well to further narrow the search.

Last search

  Select this button to do a new search including only the verses returned as a result of the last search. Use this with a new search key to narrow the search further.

## Search Results View

This shows a list of the current search results for previewing, navigation, or saving.

Preview

  To preview the search result, simply click on an individual result. The entry will show in the preview pane.

Navigation

  Navigation to the search result can be done in two ways. To open the result in a new tab, middle-click the mouse. To open the result in the current tab, double-click the result.

Save Results

  You may save your results as a list of bookmarks. To do this, right-click and select Save List. You will be prompted to enter a name for the folder that your results will be saved to. After you have saved the results, you may view them by going to your bookmarks and finding the folder you just named.

# Advanced Searches

More complicated searches might require the use of the advanced search functions, found under Edit Advanced Search.

## The Advanced Search Dialogue

The Advanced Search Dialog

In Advanced Search, much more complex queries can be constructed, involving custom search ranges, custom lists of modules over which to search, regular expression matching (see next section), and attribute-based searches such as are found in footnotes or Strong's Hebrew and Greek dictionary references.

The default search uses "lucene" fast searching. It is an optimized search requiring a pre-built index; see the Module Manager's Maintenance page for index creation. In the absence of an index, fallback to the slower, plain multi-word search will be done, or can be selected deliberately here. A web search will provide several references to the syntax needed to put to use the power of optimized Lucene search. A few examples follow:

Simple Searches: just type in the words you want to search for. To return only verses that include all of the words, prefix the word with "+". So, in the KJV, you could find Psalm 23 by searching for "+Lord +shepherd +want". To search for an entire phrase, surround the entire phrase with quotes, like "maketh me to lie down" (note that quotes are unnecessary in all of the other examples).

Single Letter Wildcard: to search for "veil" or "vail", use this syntax "v?il". The "?" represents a single character that could be anything. A more complex example returns both spellings for Isaiah used in the KJV. "?saia?" will return results for "Isaiah" and "Esaias".

Multiple Letter Wildcard: to search for "prophet" or "prophesy" or "prophecy" or "prophesied", use this syntax "prophe*".

AND syntax: in the advanced search to return results for all of the search terms, you must put "AND" in between the terms. To continue our example, if we wish to search for any occurrence of Isaiah or Esaias that also mention either prophet, or prophecy, or prophesy, we can do a search like this: "?saia? AND prophe*".

By default, two standard search ranges are defined, for Old and New Testament; you may wish to define others for e.g. "Gospels" or "Paul's Epistles". One custom module list containing only the first Bible found will be present. If desired, new searches can be performed across only the current results of the previous search. Any modules may be searched, including general books and even dictionaries, in any combination.

Note the tooltip in the screenshot above, for Attributes search. This qualifier is used to perform searches on attributes that are carried with verses, instead of verse content proper, such as footnote content or Strong's Hebrew and Greek references. If this button is selected, specific attribute qualifiers must be made in the Attribute Search tab, at the right end of the tab set. Strong's references are identified with a leading "H" or "G" and the numeric Strong's identifier. Thus, a search of KJV for Strong's Greek #140, using "G140", will return the single result of Matthew 12:18.

If you have indexed your modules, there is a much faster way to search for Strong's references. Enter your search preceded by "lemma:", so to search for Strong's Greek #140, enter "lemma:G140". You must have selected Optimized ("Lucene") for this to work.

Explanations of search syntax are available when either Optimized or Attribute search is selected.

The "Find" button also stops an in-progress search, as its tooltip indicates.

Results will show in the Results tab. If you wish to show Strongs, Morphology, or Footnote tags, make those selections on the Attributes Search tab. Clicking once on the result will show the result in the Advanced Search previewer. Hovering over Strongs, Morphology, Footnote, or Cross-reference tags will show the results in the main previewer. Double-clicking a result will cause the current tab to navigate to that result. This applies to search results in general books and commentaries as well, but note that the respective tab must be visible.

Changes to some of the settings (e.g. scope of search, searched modules, etc.) in Advanced Search will affect the simple search via the side pane but not vice versa.

# Search Syntax using Regular Expression

Regular expression searches provide a way to do simple or complex searches for strings that match a pattern or set of patterns (branches) separated by vertical bars "|". While a pattern can be built to look for a word or phrase, a simple pattern that consists of a word does not look for only that word but for any place the string of letters that make that word are found. A search for "right" will return verses that contain the word "right", but also "righteous", "righteousness", "unrighteous", "upright" and even "bright". A search for "hall not" is not a search for "hall" AND "not" but for the string "hall not" with a space between the second "l" and the "n". The search for "hall not" will find occurrences of "shall not".

The power of Regular Expressions is in the patterns (or templates) used to define a search. A pattern consists of ordinary characters and some special characters that are used and interpreted by a set of rules. Special characters include .\[^*$?+. Ordinary (or simple) characters are any characters that are not special. The backslash, "\", is used to convert special characters to ordinary and ordinary characters to special.

Example: the pattern "i. love\." will find sentences that end with "his love" or "in love" or "is love" followed by a period. The first period in "i. love\." is a special character that means allow any character in this position. The backslash in "i. love\." means that the period following it is not to be considered a special character, but is an ordinary period.

## Rules for Regular Expression Search Requests

- . The period matches any character.

- * The asterisk matches 0 or more characters of the preceding: set, character or indicated character.

- + The plus sign matches 1 or more characters of the preceding: set, character or indicated character.

- ? The question mark matches 0 or 1 character of the preceding: set, character or indicated character.

- [ ] Square brackets match any one of the characters specified inside [ ].

- ^ A caret as the first character inside [ ] means NOT.

- ^ A caret beginning a pattern anchors the beginning of a line.

- $ A dollar at the end of a pattern anchors the end of a line.

- | A vertical bar means logical OR.

- ( ) Parentheses enclose expressions for grouping. Not supported!

- \ A backslash can be used prior to any special character to match that character.

- \ A backslash can be used prior to an ordinary character to make it a special character.

### The Period

The Period "." will match any single character even a space or other non-alphabet character. s.t matches sit, set, sot, etc., which could be located in sitting, compasseth and sottish b..t matches boot, boat and beat foot.tool matches footstool and foot tool

### The Asterisk

The asterisk "*" matches zero or more characters of the preceding: set, character or indicated character. Using a period asterisk combination ".*" after a commonly found pattern can cause the search to take a very long time, making the program seem to freeze. be*n matches beeen, been, ben, and bn which could locate Reuben and Shebna.

### The Plus Sign

The Plus Sign "+" matches one or more characters of the preceding: set, character or indicated character. Using a period and plus sign combination ".+" after a commonly found pattern can cause the search to take a very long time, making the program seem to freeze. be+n matches beeen, been and ben, but not bn.

### The Question Mark

The Question Mark "?"matches zero or one character of the preceding: set, character or indicated character. be?n matches ben and bn but not been. trees? matches trees or tree.

### The Square Brackets

The Square Brackets "[]" enclose a set of characters that can match. The period, asterisk, plus sign and question mark are not special inside the brackets. A minus sign can be used to indicate a range. If you want a caret "^" to be part of the range do not place it first after the left bracket or it will be a special character. To include a "]" in the set make it the first (or second after a special "^") character in the set. To include a minus sign in the set make it the first (or second after a special "^") or last character in the set. s[eia]t matches set, sit, and sat, but not sot. s[eia]+t matches as above but also, seat, seet, siet, etc. [a-d] matches a, b, c, or d. [A-Z] matches any uppercase letter. [.;:?!] matches ., ;, :, ?, or ! but not a comma. [ ]^-] matches ] or ^ or -

### The Caret first in Square Brackets

If the Caret is the first character after the left bracket ("[^") it means NOT. s[^io]t matches set, sat, etc., but not sit and sot.

### The Caret as Start of Line Anchor

If the Caret is the first character in a pattern ("^xxx") it anchors the pattern to the start of a line. Any match must be at the beginning of a line. Because of unfiltered formatting characters in some texts, this feature does not always work, but may if a few periods are placed after the caret to account for the formatting characters. ^In the beginning matches lines that start with "In the beginning". (May need to use: ^.....In the beginning)

### The Dollar Sign as End of Line Anchor

If the Dollar Sign is the last character ("xxx$") in a pattern it anchors the pattern to the end of a line. Any match must be at the end of a line. Because of unfiltered formatting characters in some texts, this feature does not always work, but may if a few periods are placed before the dollar sign to account for the formatting characters. Amen\.$ matches lines that end with "Amen." (May need to use Amen\....$, Amen\..........$, or even Amen\....................$)

### The Vertical Bar

The Vertical Bar "|" between patterns means OR. John|Peter matches John or Peter. John .*Peter|Peter .*John matches John ... Peter or Peter ... John. (.* slows a search) pain|suffering|sorrow matches pain, or suffering, or sorrow.

### The Parentheses

The use of Parentheses "( )" is not supported!

### The Backslash Prior to a Special Character

The Backslash prior to a special character ("\*") indicates that the character is not being used in its special meaning, but is just to match itself. amen\. matches amen. but not ament and will not locate firmament.

### The Backslash Prior to an Ordinary Character

The Backslash prior to an ordinary character ("\o") indicates that the character is not being used to match itself, but has special meaning.

- \b if use outside [ ] means word boundary. If used inside [ ] means backspace. \brighteous\b matches righteous but not unrighteous or righteousness

- \B means non-word boundary. \Brighteous\B matches unrighteousness and unrighteously but not righteous, unrighteous or righteousness.

- \d means digit; same as [0-9].

- \D means non-digit, same as [^0-9].

- \s means space.

- \S means not a space.

- \w means alphanumeric; same as [a-zA-Z0-9_].

- \W means not alphanumeric; same as [^a-zA-Z0-9_].