Simple query examples
Simple queries for the CONTAINS and SCORE functions search for a single word or multiple words in a text search index.
The search engine ignores white space between characters. The search string must not be empty or contain all blanks (SQLSTATE 38H14).
The following table shows some examples of simple search queries.
| Search word types | Examples | Query results |
|---|---|---|
| Single word | king |
Returns all documents that contain the word king or kings.
This query matches different surface forms and is not case sensitive. |
| Multiple words | king lear |
Returns all documents that contain king and lear.
The default operator is the logical operator AND. |
The operators AND and + are implicit in every
query. For example, the query King Lear returns the
same results as King AND Lear or King + Lear.
You must enter the logical operators NOT, AND, and OR in all uppercase.