Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX - |
Contents
Index
![]() ![]() |
Part 1 The Basic for Developing Application | > Chapter 3 Data Search Methods | > 3.2 Searching with Character Strings | > 3.2.1 Searching for Documents that Contain a Keyword |
Broadly speaking, the following three keyword specification formats are available:
This format searches for documents that contain a given character string. Character string searches can ignore linefeeds and other characters that are not relevant.
The characters that are to be ignored as search targets can be changed using SkipChar.
Refer to System Environment Files and Director Environment Files in Appendix A, Execution Parameters in Environment Files of the Operator's Guide for more information on SkipChar.
This format searches English-language XML documents. Searches detect the character that is used to delimit words. This delimiter can be changed using SeparateChar.
Refer to System Environment Files and Director Environment Files in Appendix A, Execution Parameters in Environment Files of the Operator's Guide for more information on SeparateChar.
This format makes it possible to perform searches that are a combination of character string searches and word searches.
A more detailed search condition specification format for keywords is referred to as a 'pattern'.
The search by using the patterns is called a pattern search.Refer to B.3.4 Patterns for more information on searching by patterns.
The following table shows the different keyword specification formats and search methods.
Specification format |
Search method |
---|---|
Character string searches |
|
Word searches |
|
Logical operation searches |
|
This method can search for documents that contain a desired keyword.
Refer to String Match Specification in B.3.4 Patterns for more information on the string match specification search.
Example
Search for documents containing the keyword 'V7.0L10' in the trip purpose (purpose):
/doc/detail/purpose = 'V7\.0L10'Result: Document B is returned.
'\' is an escape character that is used to search for '.'
Refer to B.3.1 Conditional Expressions for more information on escape characters.
This method can search for documents that begin with a desired keyword.
Refer to Prefix Match Specification in B.3.4 Patterns for more information on the prefix search.
Example
Search for documents whose trip purpose (purpose) begins with the keyword 'Interstage':
/doc/detail/purpose = '^Interstage'Result: Documents A and C are returned.
This method can search for documents that end with a desired keyword.
Refer to Suffix Match Specification in B.3.4 Patterns for more information on the suffix search.
Example
Search for documents whose trip destination (destination) ends with the keyword 'branch':
/doc/detail/destination = 'branch$'Result: Document B is returned.
By combining the "prefix search" and the "suffix search", the user can search for documents whose element node character string perfectly matches a specified keyword.Example 1
Search for documents whose trip destination (destination) consists of the keyword 'Sydney branch' only:
/doc/detail/destination = '^Sydney branch$'Result: Document B is returned.
Example 2
Search for documents whose accommodation cost (hotel) is the empty string "":
/doc/detail/hotel = '^$'Result: Documents B and C are returned.
This method can search for documents where two desired keywords are located on either side of a given character string.
Refer to Free Character Specification in B.3.4 Patterns for more information on the free character specification search.
Example 1
Search for documents whose detailed information (detail) contains a keyword consisting of "sales" and "meeting" separated by zero or more characters.
/doc/detail/* = 'sales.*meeting'Result: Documents A and C are returned.
Example 2
Search for documents whose detailed information (detail) contains a keyword consisting of "$1" and "." separated by 2 characters:
/doc/detail/* = '\$1..\. 'Result: Document B is returned.
This method can search for documents that contain two desired keywords separated by no more than a specified number of characters.
Refer to Character Interval Specification in B.3.4 Patterns for more information on the character interval specification search.
Example
Search for documents whose trip purpose (purpose) contains the keywords "Interstage" and "meeting" that are separated by no more than nine characters.
/doc/detail/purpose = 'Interstage,9C,meeting'Result: Document C is returned. Document A is not returned because its keywords are separated by more than nine characters.
This method can search for documents that have one of a set of specified character strings located between two desired keywords.
Refer to Partial Character Specification in B.3.4 Patterns for more information on the partial character specification search.
Example
Search for documents that have the keywords "Richmond, Melbourne" or "Brighton, Melbourne" in the trip area (area):
/doc/detail/destination/@area = '(Richmond|Brighton)\, Melbourne'Result: Document A is returned.
This method can search for documents that include characters that lie within a specified range.
Refer to Character Range Specification in B.3.4 Patterns for more information on the character range specification search.
Example
Search for documents whose classification (classification) contains the keyword "Area-A", "Area-B" or "Area-C":
/doc/basic/classification = 'Area\-[A-C]'Result: Documents A, B, and C are returned.
This example achieves the same result as when "Area\-(A|B|C)" is specified in a partial character specification search.
This method can search for documents whose keywords contain numeric characters that lie within a specified range.
Refer to Numeric Range Specification in B.3.4 Patterns for more information on the numeric range specification search.
Example
Search for documents whose trip report (report) contains one of the following keywords: "search response of 1 second", "search response of 2 seconds", "search response of 3 seconds", ..., "search response of 11 seconds" or "search response of 12 seconds":
/doc/report = 'search response of [1,12] seconds'Result: Document A is returned.
This example achieves the same result as when "search response of (1|2|3|...|11|12) seconds" is specified in a partial character specification search.
To prevent erroneous results, specify characters on both sides of the numerals when performing a numeric range specification search. For example, if a search is conducted using the expression "search response of [1,12]", the "1" character in "search response of 18 seconds" in Document B will satisfy the expression and cause Document B to be returned, even though it is not an intended target of the search.
This method can search for documents that contain a desired word.
In the case of a word search, character strings separated by a delimiter such as a space character are recognized as keywords and searches are performed for individual words.
Refer to Word Match Specification in B.3.4 Patterns more information on the word match specification search.
Example
Search for documents that contain the keyword "Manager" in the report (report):
/doc/report = '\<Manager\>'Result: Document A is returned.
By specifying a series of keywords, the user can search for documents that contain a phrase made up of a series of words.Example
Search for documents that contain the keywords "IT Department of Company A" in the report (report):
/doc/report = '\<IT\>\<Department\>\<of\>\<Company\>\<A\>'Result: Document A is returned.
This method can search for documents that contain a phrase that contains two keywords separated by no more than a specified number of words.
Refer to Word Interval Specification in B.3.4 Patterns for more information on the word interval specification search.
Example
Search for documents in the report (report) that contain a phrase that begins with the keyword "response" and ends with the keyword "seconds", and in which both keywords are separated by no more than five words:
/doc/report = '\<response\>,5W,\<seconds\>'Result: Documents A and B are returned.
This method can search for documents in which the character string for the element node specified by the path expression matches all of a number of specified conditions.
Refer to Logical Conjunction in B.3.4 Patterns for more information on the logical conjunction specification search.
Example 1
Search for documents whose comments (comment) begin with the keyword "sales meeting" and include the keyword "verified":
/doc/detail/comment = '^Sales meeting&verified'Result: Document C is returned.
Example 2
Search for documents whose detailed information (detail) contains the keyword "Interstage" and the keywords "sales"
/doc/detail// = 'Interstage&sales'Result: Document A and C are returned.
The same search as in Example 2 can be performed even if "AND" is used as follows:Example
/doc/detail// = 'Interstage' AND /doc/detail// = 'sales'Result: Documents A and C are returned.
This method can search for documents in which the character string for the element node specified by the path expression matches one of a number of specified conditions.
Refer to Logical Disjunction in B.3.4 Patterns for more information on the logical disjunction specification search.
Example
Search for documents whose trip area (area) contains the keyword "Paddington, Sydney", "Bronte, Sydney" or "Adelaide":
/doc/detail/destination/@area = '(Paddington|Bronte)\, Sydney|Adelaide'Result: Documents B and C are returned.
This method can search for documents that do not match specified conditions.
Refer to Negation in B.3.4 Patterns for more information on the negation specification search.
Example 1
Search for documents whose trip destination (destination) does not contain the keyword "head office":
/doc/detail/destination = '~(head office)'Result: Documents A and B are returned.
Example 2
Search for documents whose trip area (area) contains the keyword "Melbourne" but does not contain the keyword "Brighton":
/doc/detail/destination/@area = 'Melbourne&~(Brighton)'Result: Document A is returned.
Contents
Index
![]() ![]() |