Generally speaking searches are handled by the SearchController and delegated to the SearchService (namely SearchServiceImpl).
Conducts a straight text search against a Bible text/commentary
Defaults to ESV, if no version is specified. Same code applies to advanced search.
The user is given the ability to lookup a Greek / Hebrew word from its lexical form (default) or from a specific form as found in the text. The checkbox in the dropdown toggles the dataset used to retrieve suggestions. "specific forms" refers to forms actually present in a text, whereas a lexical form (as stored in the lexicon_<language>.txt files) are the forms of the root word. The user is also given the ability to search by meaning, which uses the "translation" and/or the 'stepGloss' field for lexicon definition entries.
Suggestions are made from the lexicon
Searches are done:
The "original word search" offers the user the ability to search a text by referring to the original word. The suggestions can be given in Greek, Hebrew or by English Meaning. The data behind those suggestions is an indexed copy of the lexicon_greek.txt, lexicon_hebrew.txt, specific_forms. OriginalWordSuggestionServiceImpl is used to provide the relevant data. In particular, the data in the lexicon comes from:
Help the user find a particular passage by listing subjects based on the search query. Currently operates on 2 datasets, and three types of search: ESV headings, Nave concordance (top headings), Nave concordance (all headings)
Take the search query.
The code for the search layout can be found under advanced_search.jsp. This defines the layout of the text boxes into which the user keys in his search criteria. Handlers and other UI components are found in js/search/*ui.js. A few key areas warrant special mention:
trackState()
adds a handler to textbox which tracks every time a value is committed to a textbox/checkbox (e.g. a blurring event, or the user hits the Enter key). This is then stored in the local storage, made available by HTML5. Values in the local storage for search can be found by calling the following method:
step.state.<searchTypeNamespace>.<textboxClass>(passageId)
For example step.state.simpleText.simpleTextCriteria(0)
would retrieve the value stored for the "simpleTextCriteria" textbox in the left-hand column.
Generally, a ui.js
will contain its own evaluateQuerySyntax
method. For example, for the original word search, this is step.search.ui.original.evaluateQuerySyntax(). This method is responsible for creating a query syntax that the server can understand. The query syntax is re-evaluated on each key stroke. .ui.js
files call the step.util.ui.trackQuerySyntax(classNameOfParentElement, searchTypeNamespace) method in order to set up the event handlers for key strokes.
step.util.ui.trackQuerySyntax(".wordSearch", "original");