LDSTechForumProjects

Community Services Scripture Search Service



!!! THIS PAGE IS OUTDATED, THE URLS ARE NOT WORKING. PLEASE UPDATE WITH CORRECT URLS. !!!



Overview

This service allows you to search the LDS Standard Words and return information that you can use in your application. This service has a single method with several parameters that allow you to specify the way the results are returned, allowing you great control over how these results are used in your application.

Base URL

http://174.143.171.136/scriptures/mobile/

Methods

search.xqy

This method allows you to query the LDS Standard Works and return the results in XML, JSON, or text format.

Endpoint

search.xqy?{parameter1}[&{parameter2}&parameterX}]

Type

XML, JSON, text

Authentication Required

No

Parameters

help - A help file with information similar to what is in this document.
Required: No
Valid Values: [true|false]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?help=true
Note: This parameter overrides any other parameter. When used, other parameters are ignored, and the help file is displayed.
stop-word - Specify whether stop words (common words) should be retained or removed.
Required: No
Valid Values: [remove|retain]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&stop-words=remove
Additional Information: The stop words used in this service are: a, am, an, and, are, as, at, be, been, but, by, for, from, how, i, if, in, is, it, nor, not, of, on, or, out, that, the, these, this, those, to, too, was, were, what, when, where, who, whose, why, ye, yea, you. In the example above, "of" is a stop word, so it will be removed from the query term. For a list of the stop words used in this service in an XML format, see LDS Scriptures Service Stop Words.
Note: If you combine phrase=true and stop-words=remove, the phrase will have any stop words contained inside it removed. For that reason, this combination of parameters should be used with caution.
terms - A string of characters, numbers, and whitespace (with whitespace represented by a + sign).
Required: Yes
Valid Values: [a-zA-Z0-9+]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom
Additional Information: If this parameter is not specified, a response element of type=empty will be returned.
testament - Used to designate a single testament, a combination of testaments, or all testaments. Invalid values are ignored.
Required: No
Valid Values: [all|ot|nt|bofm|dc|pgp|jst]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&testament=ot,bofm,jst
Additional Information: The values represent the volumes of LDS Scripture, as defined below:
  • ot = Old Testament
  • nt = New Testament
  • bofm = The Book of Mormon
  • dc = Doctrine and Covenants
  • pgp = The Pearl of Great Price
  • jst = The Joseph Smith Translation (of the Bible)
element - Specify whether chapters or verses will be used for relevance rank and snippeting.
Required: No
Valid Values: [verse|chapter]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&element=verse
Note: The parameter element=chapter is not yet implemented, so element=verse will be used in all queries, regardless of how this parameter is set.
page - Used to specify which page of results to return.
Required: No
Valid Values: [>=1,<=m]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&page=3
Additional Information: Valid values are any integer greater than or equal to 1, which is less than or equal to the maximum number of pages. If the integer used is greater than the maximum number of pages, no results are displayed.
results - Used to specify the number of results to return per page.
Required: No
Valid Values: [1<=x<=100,10]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&results=25
Additional Information: Valid values are any integer between 1 and 100 (inclusive). Default value is 10.
highlight - Used to specify whether matching terms should be highlighted.
Required: No
Valid Values: [true|false]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&highlight=false
format - Used to specify the format for the returned results.
Required: No
Valid Values: [xml|json|text]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&format=json
Additional Information: XML content type is application/xml. JSON content type is application/json. Text content type is text/plain. Output format of text output is the same as the JSON format, but with the different content type of text/plain.
include-uri - Used to specify whether the URI attribute should be included.
Required: No
Valid Values: [true|false]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&include-uri=true
Additional Information: The URI attribute can be used to jump directly to a verse or chapter element when directly querying XML. This parameter is used for applications that have a local copy of the official LDS Scriptures in ldsXML format.
case-sensitive - Used to specify whether the search terms are case-sensitive.
Required: No
Valid Values: [true|false]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&case-sensitive=true
snippet - Used to specify whether the search result text should be the entire verse, or an extract of words surrounding the matching terms.
Required: No
Valid Values: [verse|extract]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&snippet=extract
phrase - Used to specify whether the terms should be treated as a contiguous phrase or as individual terms.
Required: No
Valid Values: [true|false]
Example: http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&phrase=true
Additional Information: Note: If you combine phrase=true and stop-words=remove, the phrase will have any stop words contained inside it removed. For that reason, this combination of parameters should be used with caution.

Response

XML Example (truncated)
<?xml>
<R>Response missing. Need info</R>
JSON /Text Example
{"QUERY":"word of wisdom","TOTAL":"28","RESULTS":[{"B":"dc","T":"Doctrine and Covenants","C":"88","V":"118","P":"And 
as all have not faith, seek ye diligently and teach one another <h>words<\/h> <h>of<\/h> <h>wisdom<\/h> ; yea, seek 
ye out <h>of<\/h> the best books <h>words<\/h> <h>of<\/h> <h>wisdom<\/h> ; seek learning, even by study and also by 
faith."},{"B":"dc","T":"Doctrine and Covenants","C":"109","V":"7","P":"And as all have not faith, seek ye diligently 
and teach one another <h>words<\/h> <h>of<\/h> <h>wisdom<\/h> ; yea, seek ye out <h>of<\/h> the best books <h>words<\/h> 
<h>of<\/h> <h>wisdom<\/h> , seek learning even by study and also by faith;"}]}

Examples Show all verses that contain the exact phrase "SAVIOR OF".

http://174.143.171.136/scriptures/mobile/search.xqy?terms=SAVIOR+OF&phrase=true


Show all verses that contain the exact phrase "SAVIOR OF" in JSON format.

http://174.143.171.136/scriptures/mobile/search.xqy?terms=SAVIOR+OF&phrase=true&format=json


Show all verses in the Doctrine and Covenants that contain any of the words in "Word of Wisdom," but make it case-sensitive and don't use highlights in the results.

http://174.143.171.136/scriptures/mobile/search.xqy?terms=word+of+wisdom&testament=dc&case-sensitive=true&highlight=false

This page was last modified on 6 September 2011, at 00:26.

Note: Content found in this wiki may not always reflect official Church information. See Terms of Use.