15. Match Phrase¶
The match_phrase query analyzes the text and creates a phrase query out of the analyzed text.
A sample search
1<?php
2
3$elastic = new ElasticSearch();
4
5$phrase = $elastic->matchPhrase()
6 ->index('my-index')
7 ->field('name')
8 ->text('I use Elastic Search')
9 ->addition(['slop' => 1])
10 ->search();
11
12return $phrase;