Advanced Search Expressions

<< Click to Display Table of Contents >>

Navigation:  Searching and Indexing >

Advanced Search Expressions

The Search Toolbar, Search Bible dialog (normal and proximity searches), Quick Concordance, Search KJV Words of Christ, and Full Library Search functions all support an advanced search expression syntax, described here.

 

Note that in most cases, the search options provided in the Search Bible and the Full Library Search dialogs will provide you with enough control over the search that it will not be necessary to use any advanced search expressions.

 

You can safely skip this help topic if you only want to use SwordSearcher's standard search features.

 

Simple Word and Phrase Searching

 

A simple search can include one or more words, like this:

 

 lord jesus christ

 

A Bible search for the above would find verses containing all three words, in any order or location in the verse. A library search would likewise find book and commentary entries with all three words, appearing in any order or location in the entry text. This is referred to as a Boolean AND search.

 

A phrase search is specified by using quotation marks, like this:

 

 "lord jesus christ"

 

The above would find verses or entries that have the three words in the exact order.

 

Most searching in SwordSearcher disregards punctuation. A phrase search ignores punctuation in such a way that a search for "one two" would match text like "one, two." or "one two" or "one! two!" If you must perform a Bible search that includes punctuation, use Character String Search.

 

Boolean Expressions

 

Boolean expressions allow you to combine comparison operations like OR, AND, NOT, and XOR, and use parentheses to group operations.

 

A simple example is to take our original search, lord jesus christ, and make it find verses with any of the words, rather than only verses with all of the words. We do this by adding the logical OR operator, which is a pipe (|) symbol (Shift+\ on your keyboard):

 

 lord | jesus | christ

 

Unlike the first example, which would only find verses or entries with all three words, this search will find verses or entries that have any of the three words.

 

Now suppose we wanted to do something more complex, like find verses that have the phrase "lord jesus" or the word "christ". That search would look like this:

 

 "lord jesus" | christ

 

Boolean expressions can also include parentheses to group operations. So, if you want to find any verse that has the three words lord, jesus, and christ, OR the exact phrase "lord god", you would specify your search like this:

 

 (lord & jesus & christ) | "lord god"

 

The & symbol is the logical AND operator, and isn't actually required since AND is assumed. It's included here for clarity.

 

Here is a complete list of the Boolean operators SwordSearcher supports, in the order of precedence:

 

( )

precedence, as in above example

!

Logical NOT

&

Logical AND

|

Logical OR

^

Logical XOR (exclusive OR, meaning: one but not both)

 

Again, a phrase is specified by placing text in quotes: "this is a phrase". If no Boolean operators are included in your search text, AND (&) is assumed.

 

Spelling out Boolean operators like AND or NOT is not supported because those words may frequently be part of the search itself. Therefore you must use the operator tokens listed above (!, &, |, ^).

 

There is an additional pseudo-Boolean operator @ explained at the end of this topic.

 

Modifier Tokens

 

The advanced search expression syntax supports several enhanced comparison modes that are applied on a per-word basis by using modifier tokens. A modifier token is placed just before or just after a word, or in some cases, inside a word.

 

For example, the wildcard token (*) placed after some letters tells SwordSearcher to search for any word starting with the letters. A search for

 

 god*

 

Finds god, godly, etc.

 

Here is a complete list of token modifiers and their functions, followed by more detailed examples:

 

Token

Name

Function

* (asterisk)

Wildcard

Stands for any sequence and count of letters.

? (question mark)

Wild character

Stands for a single character

_ (underscore)

Case sensitive compare

Forces the word to be compared sensitive to case.

= (equals symbol)

English stemming

Finds all forms of the word

~ (tilde)

Fuzzy (loose) matching

Finds words that mostly look the same as the specified word

 

Wildcard (*)

 

Use the wildcard token to find any string of characters. Examples:

 

god*

*god

*god*

g*d

 

Wild character (?)

 

Use the wild character to stand in for any single character.

 

lo?e

 

Finds love, lose, etc.

 

You can freely mix * and ? tokens in a word as needed.

 

Case sensitivity (_)

 

The Search Bible and Full Library Search dialogs allow you to do a case sensitive search, but the case sensitivity token makes it possible to mark a single word as case sensitive. For example:

 

_lord & god

 

Finds verses with both the words lord and god, but only matches the word lord when the letters are all lower case. The word god will still match god, God, and GOD, because it lacks the case sensitivity modifier token.

 

English stemming (=)

 

Place the stemming token after a word to find all word forms. For example:

 

jesus & love=

 

Finds verses that have the word jesus and also a form of the word love, such as love, loved, loveth, and lovest.

 

The English stemming comparison function only works on English texts. It works with older word forms like those in the KJV. However, it is algorithmic, which means that it is not 100% accurate. If you need precise word counts, etc, you should not use stemming.

 

Fuzzy matching (~)

 

Use the fuzzy matching token to tell SwordSearcher to match words that mostly look the same. This is a "loose matching" function and can be useful when you are not sure of the spelling of a word. For example:

 

color~

 

Finds verses with the word colour and colours.

 

While fuzzy matching is useful, it can frequently be too lenient. If you need help finding the spelling of a Bible word, you can also try using the Word List function of the Search Bible dialog, which implements a fuzzy matching list but allows you to search for just the words you want once you find them.

 

Tips

 

A search that combines a phrase search and one or more words is assumed to be a Boolean AND search for the phrase and the words. Therefore, the following search texts are equivalent:

 

 "jesus christ" saviour

 "jesus christ" & saviour

 

You can use wildcards and other modifier tokens inside of a phrase. For example, the search:

 

 "love= not"

 

performs stemming on love and would find verses like the following:

 

Proverbs 15:12  A scorner loveth not one that reproveth him: neither will he go unto the wise.

Proverbs 20:13 Love not sleep, lest thou come to poverty; open thine eyes, and thou shalt be satisfied with bread.

Revelation 12:11  And they overcame him by the blood of the Lamb, and by the word of their testimony; and they loved not their lives unto the death.

 

Searching in SwordSearcher always ignores punctuation, unless you use a Bible Character String search or Regular Expression search.

 

Boolean operators do not need to be padded with spaces. The following search texts are equivalent:

 

jesus|christ|saviour

jesus | christ | saviour

 

Boolean operations are evaluated in a strict order of precedence. The table under Boolean Expressions above lists them in the order that they are evaluated. If you are having difficulty getting the desired effect with a Boolean search, it can often be helpful to use parentheses around the operations you want evaluated first. (A complete discussion of Boolean logic is outside the scope of this documentation.)

 

Special @ and @! operators: find text translated from or "not" translated from

 

This is a very complex search operator used internally by the English-Strong's Indexer. Typically, you would just use the ESI rather than specifying searches with these operators manually.

 

The KJV and KJVSL Bible modules support an additional pseudo-Boolean operator @ which means "translated from Strong's number." It is used like this:

 

kind @ G1085

 

Which finds the word "kind" when it is translated from G1085.

 

The @! operator means "not translated from" and is used like this:

 

kind @! G1085

 

Which finds the word "kind" when it is not translated from G1085.

 

You can provide a list of Strong's numbers and they will be treated as OR matches:

 

love @ g25 g26

 

Which finds "love" when it is translated from G25 or G26.

 

The @ and @! operators have the highest precedence and are evaluated before Boolean operators. It is possible to use additional Advanced Search Expression modifier tokens on the English portions of the search in combination with the @ operators, but it is best to keep things simple.

 

Finally, a special wild card for Strong's matching is supported:

 

kind @ *

 

Which will match all of the occurrences of "kind" and capture the Strong's numbers tagged for that portion of the text, for examination in the Verse List and its Search Result Details and Statistics.

 

Technically speaking, these searches are not actually aware of translation considerations. It is easy to search for things like articles (the, etc) from a Strong's number and get many results that don't have translational significance. These searches are limited to the information provided by the Strong's tagging in the KJVSL and are not intended to produce definitive information regarding original language text or translation.