Reputation:
i want to search with elasticsearch and show out the result with php. i want to make partial match like it's in mysql for ex:
select * from table_name where title like '%abc%'
But my codes doesn`t work:
$params = [
'index' => 'my_index',
'type' => 'my_type',
'body' => [
'query' => [
'match' => [
'title' => '.*abc.*'
]
]
]
];
Upvotes: 1
Views: 563
Reputation:
I was using 'match' instead of 'regex'
$params = [
'index' => 'my_index',
'type' => 'my_type',
'body' => [
'query' => [
'regexp' => [
'title' => '.*abc.*'
]
]
]
];
Upvotes: 3