Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mapping feature to models #18

Open
mikehaertl opened this issue Sep 30, 2013 · 2 comments
Open

Add mapping feature to models #18

mikehaertl opened this issue Sep 30, 2013 · 2 comments

Comments

@mikehaertl
Copy link
Collaborator

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.

@mikehaertl
Copy link
Collaborator Author

@phpnode Any opinion on this?

@phpnode
Copy link
Member

phpnode commented Oct 9, 2013

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants