У меня есть ошибка в symfony проекте "неправильный запрос multi_match, нет start_object после имени запроса" в Symfony ApiPlatform с использованием Elasti c search?
Я хочу использовать Оператор OR в запросе Elasticsearch с использованием php symfony.
Это файл SearcheFilter (web / src / Bridge / Elastica / Filter / SearchFilter. php):
case self::STRATEGY_OR:
$values = array_map('strtolower', $values);
$multiFieldQuery = new QueryMultiMatch;
if ('departmentOrNeighboring' === $field) {
$multiFieldQuery->setFields(['dead.department.name', 'neighboringDepartments.name']);
$multiFieldQuery->setQuery($values[0]);
$multiFieldQuery->setMinimumShouldMatch('100%');
}
if ('regionOrNeighboring' === $field) {
$multiFieldQuery->setFields(['dead.region.name', 'neighboringDepartments.regionName']);
$multiFieldQuery->setQuery($values[0]);
$multiFieldQuery->setMinimumShouldMatch('100%');
}
$boolQuery->addMust($multiFieldQuery);
break;
и это поля аннотации сущности:
/**
* Obituary
*
* @ORM\Table(name="obituary", indexes={@ORM\Index(name="type", columns={"type", "status"}), @ORM\Index(name="status", columns={"status", "publication_date"})})
*
* @ApiResource(
* attributes={
* "normalization_context"={"groups"={"obituary-read"}},
* "denormalization_context"={"groups"={"obituary-write"}}
* },
* collectionOperations={
* "get"={
* "method"="GET",
* },
* "post"={
* "method"="POST",
* }
* },
* itemOperations={
* "get"={
* "method"="GET",
* },
* "put"={
* "method"="PUT",
* },
* "delete"={
* "method"="DELETE",
* },
* }
* )
*
* @ApiFilter(SearchFilter::class, properties={
* "dead.firstName": "exact",
* "dead.lastName": "exact",
* "dead.deathDate": "exact",
* "dead.postalCode": "exact",
* "publicationDate": "exact",
* "type": "exact",
* "status": "exact",
* "operator": "exact",
* })
* @ApiFilter(ObituarySearchFilter::class, properties={
* "neighboringDepartments.name": "or",
* "neighboringDepartments.parentCode": "exact",
* "dead.town.name": "exact",
* "dead.department.name": "or",
* "dead.region.name": "exact",
* "dead.namesDead": "partial",
* "dead.institution.id": "exact",
* "dead.institution.business.id": "exact",
* "departmentOrNeighboring": "or",
* "regionOrNeighboring": "or",
* })
* @ApiFilter(DateFilter::class, properties={"dead.deathDate", "publicationDate", "createdDate"})
* @ApiFilter(OrderFilter::class, properties={"dead.deathDate", "dead.firstName", "dead.lastName", "dead.town.name", "publicationDate", "createdDate"})
*
* @ORM\Entity(repositoryClass="App\Repository\ObituaryRepository")
*/
Так что я не знаю, откуда возникла проблема.