Code Duplication    Length = 16-16 lines in 4 locations

_inc/lib/jetpack-wpes-query-builder/jetpack-wpes-query-parser.php 4 locations

@@ 235-250 (lines=16) @@
232
				$n = preg_replace( '/"/', '', $n );
233
			}
234
235
			if ( !empty( $args['must_query_fields'] ) && !$filtering ) {
236
				if ( $is_phrase ) {
237
					$this->add_query( array(
238
						'multi_match' => array(
239
							'fields' => $args['must_query_fields'],
240
							'query' => $n,
241
							'type' => 'phrase',
242
					) ) );
243
				} else {
244
					$this->add_query( array(
245
						'multi_match' => array(
246
							'fields' => $args['must_query_fields'],
247
							'query' => $n,
248
					) ) );
249
				}
250
			}
251
252
			if ( !empty( $args['boost_query_fields'] ) ) {
253
				if ( $is_phrase ) {
@@ 252-267 (lines=16) @@
249
				}
250
			}
251
252
			if ( !empty( $args['boost_query_fields'] ) ) {
253
				if ( $is_phrase ) {
254
					$this->add_query( array(
255
						'multi_match' => array(
256
							'fields' => $args['boost_query_fields'],
257
							'query' => $n,
258
							'type' => 'phrase',
259
					) ), 'should' );
260
				} else {
261
					$this->add_query( array(
262
						'multi_match' => array(
263
							'fields' => $args['boost_query_fields'],
264
							'query' => $n,
265
					) ), 'should' );
266
				}
267
			}
268
		}
269
270
		if ( ! empty( $user_ids ) ) {
@@ 325-340 (lines=16) @@
322
				$t = preg_replace( '/"/', '', $t );
323
			}
324
325
			if ( ! empty( $args['must_query_fields'] ) ) {
326
				if ( $is_phrase ) {
327
					$this->add_query( array(
328
						'multi_match' => array(
329
							'fields' => $args['must_query_fields'],
330
							'query' => $t,
331
							'type' => 'phrase',
332
					) ) );
333
				} else {
334
					$this->add_query( array(
335
						'multi_match' => array(
336
							'fields' => $args['must_query_fields'],
337
							'query' => $t,
338
					) ) );
339
				}
340
			}
341
342
			if ( ! empty( $args['boost_query_fields'] ) ) {
343
				if ( $is_phrase ) {
@@ 342-357 (lines=16) @@
339
				}
340
			}
341
342
			if ( ! empty( $args['boost_query_fields'] ) ) {
343
				if ( $is_phrase ) {
344
					$this->add_query( array(
345
						'multi_match' => array(
346
							'fields' => $args['boost_query_fields'],
347
							'query' => $t,
348
							'type' => 'phrase',
349
					) ), 'should' );
350
				} else {
351
					$this->add_query( array(
352
						'multi_match' => array(
353
							'fields' => $args['boost_query_fields'],
354
							'query' => $t,
355
					) ), 'should' );
356
				}
357
			}
358
		}
359
360
		return true;