-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Hi,
I'm new with Elastic. I would like to search by multiple form fields.
For example I have my form with: company_name, contacts.first_last_name.
In my Elastic structure I have company_name, contacts.firstname, contacts.lastname
I want search by name (concat firstname and lastname) but if I filled the company_name form field I want to search company_name AND firstname + lastname
I think it's working with concat field, but who to add other field ?
$clients = Client::searchByQuery([
'multi_match' => [
'query' => $request->get('first_last_name'),
"type" => "cross_fields",
'operator' => 'and',
'fields' => [
'contacts.firstname',
'contacts.lastname',
]
]
]);Btw, how to add some checkboxes to the query with Elasticquent ? Of course, firstname, lastname and company_name will be included in the query too. I think it's a complex filter :/
Thx.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels