codemix / codemix/YiiElasticSearch
Add mapping feature to models
- Dominant language
- PHP
- Stars
- 33
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
Alternatively to the mapping file, we could keep the mapping definition inside the model.
I'd suggest a syntax like this:
``` [php]
public function elasticMapping()
{
return array(
'id' => array('type' => 'integer'),
'name' => array('type' => 'string', 'index'=>'not_analyzed'),
...
);
}
```
Then `./yiic elastic map --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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.