Elasticquent
Elasticquent copied to clipboard
mappingProperties show no effect
No matter what mappingProperties I define in my model, they're completely ignored. All types are strings. I have overwritten the addAllToIndex method to have fully control over things that happen when all things get indexed, no effect, all attributes are strings. ` protected $mappingProperties = [ 'created_at' => [ 'type' => 'date', "format" => "yyyy-mm-dd" ], ... ]; public static function addAllToIndex() { $instance = new static;
$pictures = $instance->newQuery()->get(array('*'));
foreach($pictures as &$picture) {
$picture->created_at = (int)strtotime($picture->created_at);
$picture->updated_at = (int)strtotime($picture->updated_at);
$picture->gallery = Galleries::find($picture->galleries_id);
}
return $pictures->addToIndex();
}`
Migration is done via Blueprint like this:
Schema::create('pictures', function (Blueprint $table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->integer('pages_id')->unsigned()->nullable(); ... );
Maybe, I'm mislead somewhere. Is someone willing to help? Thanks in advance!
I have the same problem @timgws
+1 any update on this? I have the same issue.
+1. I'm waiting too.