Db2 Text Search and NSE semantic and syntactic differences for searching
Db2 Text Search and Net Search Extender differ both semantically and syntactically. It is important to be aware of the differences between the two search servers.
Use the following tables illustrating plain and structured text searches to help you understand differences in full-text search language processing.
Feature or attribute | Net Search Extender syntax | Corresponding Db2 Text search syntax | Comments |
---|---|---|---|
Double quotation marks |
|
Example 1:
Example 2:
|
Net Search Extender uses double-quotation marks. For Db2 Text Search this translates into a phrase search. If you want to apply the default stemmed or lemma search in text search, the double quotation marks must be removed in Db2 Text Search. |
Scoring algorithm |
|
|
The scoring algorithm in Net Search Extender is different. This often results in a difference in the ordering of results |
Enabling use of synonyms |
|
|
|
Boolean operators |
|
|
Net Search Extender uses &, |, NOT operators. Db2 Text Search uses AND (&&), OR (||) and NOT (-) operators. |
Case sensitivity | Example 1:
Example 2:
|
Example 1:
Example 2:
|
In example 1, Net Search Extender searches for the sequence 'great adventure'. This translates into a case-insensitive phrase search in Db2 Text Search. In example 2, Net Search Extender searches for the cases-sensitive term. Db2 Text Search searches the case-insensitive form of the search term, will find Tree, but not trees. |
Wildcard (single character) |
|
|
Net Search Extender uses the _ operator. Db2 Text Search uses the ? operator. |
Wildcard (multiple characters) |
|
|
Net Search Extender uses the % operator. Db2 Text Search uses the
* operator. Important: a % sign preceding a search term denotes an
optional term in Db2 Text Search.
|
Stemmed search |
|
|
Stemmed search for Net Search Extender will find 'child' and 'children' in this example. This is default search behavior for Db2 Text Search, a search for children will include documents containing child as well. |
Fuzzy search | Example 1:
Example 2:
|
Example 1:
Example 2:
|
Example 1 shows the default syntax for a fuzzy search. The default match level of Net Search Extender is 80, the default for Db2 Text Search is 0.5. Example 2 shows how to specify the degree by explicitly adding a factor. |
Proximity search | Example 1:
Example 2:
|
Example 1:
Example 2:
|
Db2 Text Search uses the number of words, not the grammatical structure. |
Restricting the number of results |
|
|
|
Free text search |
|
Example 1:
Example 2:
|
The 'is about' option searches for documents containing any of the words, it can be represented either by a query that combines the terms with OR (in case all of them are relevant) or alternatively, simply a search for the interesting term. |
Feature or attribute | Net Search Extender | Corresponding Db2 Text search syntax | Comments |
---|---|---|---|
Structured search with SQL |
|
|
|
Structured search with XQuery |
|