Skip to content

Commit

Permalink
Changed Documentation
Browse files Browse the repository at this point in the history
Signed-off-by: GabeFernandez310 <[email protected]>
  • Loading branch information
GabeFernandez310 committed Nov 21, 2022
1 parent 595ab32 commit 5c48bb5
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/user/dql/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2769,6 +2769,46 @@ Another example to show how to set custom values for the optional parameters::
+----------------------+--------------------------+


MATCHPHRASEQUERY
------------

Description
>>>>>>>>>>>

``matchphrasequery(field_expression, query_expression[, option=<option_value>]*)``

The matchphrasequery function maps to the match_phrase query used in search engine, to return the documents that match a provided text with a given field.
It is an alternate syntax for the `match_phrase`_ function. Available parameters include:

- analyzer
- slop
- zero_terms_query

For backward compatibility, matchphrase is also supported and mapped to match_phrase query.

Example with only ``field`` and ``query`` expressions, and all other parameters are set default values::

os> SELECT author, title FROM books WHERE match_phrase(author, 'Alexander Milne');
fetched rows / total rows = 2/2
+----------------------+--------------------------+
| author | title |
|----------------------+--------------------------|
| Alan Alexander Milne | The House at Pooh Corner |
| Alan Alexander Milne | Winnie-the-Pooh |
+----------------------+--------------------------+

Another example to show how to set custom values for the optional parameters::

os> SELECT author, title FROM books WHERE match_phrase(author, 'Alan Milne', slop = 2);
fetched rows / total rows = 2/2
+----------------------+--------------------------+
| author | title |
|----------------------+--------------------------|
| Alan Alexander Milne | The House at Pooh Corner |
| Alan Alexander Milne | Winnie-the-Pooh |
+----------------------+--------------------------+


MATCH_BOOL_PREFIX
-----

Expand Down

0 comments on commit 5c48bb5

Please sign in to comment.