algolia / algolia/search-bundle
Fields not indexed
- Dominant language
- PHP
- Stars
- 193
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Description
- Symfony version: 5.4.25
- Algolia Search Bundle version: 6.0.1
### Description
I have a simple entity with a custom type field, a Point for storing a location. The field is "tagged" as searchable but appears empty in my indexes.
The entity:
```
id;
}
/**
* @param string $id
* @return Event
*/
public function setId(string $id): Event
{
$this->id = $id;
return $this;
}
/**
* @return string
*/
public function getTitle(): string
{
return $this->title;
}
/**
* @param string $title
* @return Event
*/
public function setTitle(string $title): Event
{
$this->title = $title;
return $this;
}
/**
* @return Point
*/
public function getLocation(): Point
{
return $this->location;
}
/**
* @param Point $location
* @return Event
*/
public function setLocation(Point $location): Event
{
$this->location = $location;
return $this;
}
/**
* @return User
*/
public function getOrganizer(): User
{
return $this->organizer;
}
/**
* @param User $organizer
* @return Event
*/
public function setOrganizer(User $organizer): Event
{
$this->organizer = $organizer;
return $this;
}
/**
* @return string
*/
public function getDescription(): string
{
return $this->description;
}
/**
* @param string $description
* @return Event
*/
public function setDescription(string $description): Event
{
$this->description = $description;
return $this;
}
/**
* @return bool
*/
public function isSecret(): bool
{
return $this->isSecret;
}
/**
* @param bool $isSecret
* @return Event
*/
public function setIsSecret(bool $isSecret): Event
{
$this->isSecret = $isSecret;
return $this;
}
/**
* @return \DateTimeImmutable
*/
public function getStartDate(): \DateTimeImmutable
{
return $this->startDate;
}
/**
* @param \DateTimeImmutable $startDate
* @return Event
*/
public function setStartDate(\DateTimeImmutable $startDate): Event
{
$this->startDate = $startDate;
return $this;
}
/**
* @return \DateTimeImmutable
*/
public function getCreatedAt(): \DateTimeImmutable
{
return $this->createdAt;
}
/**
* @param \DateTimeImmutable $createdAt
* @return Event
*/
public function setCreatedAt(\DateTimeImmutable $createdAt): Event
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return \DateTimeImmutable
*/
public function getUpdatedAt(): \DateTimeImmutable
{
return $this->updatedAt;
}
/**
* @param \DateTimeImmutable $updatedAt
* @return Event
*/
public function setUpdatedAt(\DateTimeImmutable $updatedAt): Event
{
$this->updatedAt = $updatedAt;
return $this;
}
}
```
The Point entity:
```
lat = $lat;
$this -> long = $long;
}
/**
* @return float
*/
public function getLat(): float
{
return $this->lat;
}
/**
* @param float $lat
* @return Point
*/
public function setLat(float $lat): Point
{
$this->lat = $lat;
return $this;
}
/**
* @return float
*/
public function getLong(): float
{
return $this->long;
}
/**
* @param float $long
* @return Point
*/
public function setLong(float $long): Point
{
$this->long = $long;
return $this;
}
public function __toString(): string
{
return sprintf('POINT(%f %f)', $this -> lat, $this -> long);
}
}
```
And the Point type:
```
getLat(), $value -> getLong());
}
return $value;
}
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
{
return sprintf('PointFromText(%s)', $sqlExpr);
}
public function canRequireSQLConversion()
{
return true;
}
}
```
Here is my SearchBundle config:
```
algolia_search:
prefix: '%env(APP_ENV)%_'
indices:
- name: events
class: App\Entity\Event
enable_serializer_groups: true
```
The fact is I want the Points in Events to be indexed to make geo queries on it.
### Steps To Reproduce
Contributor guide
Research direction
Start with the App\Entity\Event searchable serializer groups, the App\Entity\Point fields, and App\Type\PointType conversion methods, then inspect how the configured events index consumes them. Reproduce the indexing with the shown algolia_search configuration and verify that location is present in indexed events and usable for geo queries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- backend, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100