Skip to content

Add mapping feature to models #18

@mikehaertl

Description

@mikehaertl

Alternatively to the mapping file, we could keep the mapping definition inside the model.

I'd suggest a syntax like this:

public function elasticMapping()
{
    return array(
        'id' => array('type' => 'integer'),
        'name' => array('type' => 'string', 'index'=>'not_analyzed'),
        ...
    );
}

Then ./yiic elastic map --model=<model> would use the data above to find the right mapping.

Not sure, if we should also automate this for the regular auto-indexing on save(). This would require a check on every save operation, whether the mapping exists. Probably a bit too extreme.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions