Skip to content

Commit

Permalink
Added wildcard filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Radiergummi committed Apr 22, 2021
1 parent 1d1ff6f commit a7f7f1b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Concerns/BuildsFluentQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,24 @@ public function prefixFilter(string $field, $value): self
]);
}

/**
* Shorthand to add a "wildcard" filter.
*
* @param string $field Name of the field to add a filter for
* @param string|array|callable $value Filter value. Either a string value,
* an array of Elasticsearch parameters,
* or a callable that returns either of
* the previous.
*
* @return $this
*/
public function wildcardFilter(string $field, $value): self
{
return $this->filter('wildcard', [
$field => value($value, $this, $field),
]);
}

/**
* Shorthand to add a "regexp" filter.
*
Expand Down

0 comments on commit a7f7f1b

Please sign in to comment.