Log message #4157326

# At Username Text
# Jul 10th 2018, 10:03 james.phillips ive added elastic plugin
# Jul 10th 2018, 10:03 josbeir and indeed @james.phillips you need to add elastic :P
# Jul 10th 2018, 10:03 lorenzo `$this->loadModel('Comments', 'elastic');` Load the `CommentsIndex` model from the `elastic` datasource
# Jul 10th 2018, 10:03 james.phillips makes sense and that matchs my datasource name I added in my config
# Jul 10th 2018, 10:03 josbeir @lorenzo thanks !
# Jul 10th 2018, 10:02 james.phillips so loadmodel elastic = datasource elastic
# Jul 10th 2018, 10:01 james.phillips Im guessing i missed a step
# Jul 10th 2018, 10:01 james.phillips theres where I grabbed the code from ... so when I add the following code to my existing controller I get that error message public function initialize() { parent::initialize(); $this->loadModel('Comments', 'elastic'); }
# Jul 10th 2018, 10:01 lorenzo @josbeir https://github.com/cakephp/elastic-search/releases/tag/2.0.0-RC2
# Jul 10th 2018, 09:58 lorenzo read here https://github.com/cakephp/elastic-search#getting-a-index-object
# Jul 10th 2018, 09:57 lorenzo `'elastic'` is not a model, it is a datasource
# Jul 10th 2018, 09:56 james.phillips thank god for source control software to remind me what random stuff ive done
# Jul 10th 2018, 09:55 james.phillips i still had $this->loadModel('elastic'); in my code from some other doc
# Jul 10th 2018, 09:53 josbeir you are trying to retrieve a record or ?
# Jul 10th 2018, 09:53 josbeir and when does this happen?
# Jul 10th 2018, 09:52 james.phillips but if I change it to elastic123 it still says Error: Unknown repository type "elastic". Make sure you register a type before trying to use i
# Jul 10th 2018, 09:51 james.phillips yep... 'elastic' => [ 'headers' => ['Authorization' => 'api-sfsadfas'], 'className' => 'Cake\ElasticSearch\Datasource\Connection', 'driver' => 'Cake\ElasticSearch\Datasource\Connection', 'host' => 'https://host-7djrft.api.swiftype.com/api/as/v1/engines/asdfasdfas/', 'port' => 9200, 'index' => '', ],
# Jul 10th 2018, 09:49 josbeir is your datasource definition called 'elastic' ?
# Jul 10th 2018, 09:48 josbeir can you show the stack trace?
# Jul 10th 2018, 09:47 josbeir people would add very different information to all types in the same index
# Jul 10th 2018, 09:47 james.phillips the auth header def did something cos i get a different error now ;) Error: Unknown repository type "elastic". Make sure you register a type before trying to use it.
# Jul 10th 2018, 09:47 josbeir in ES prior to version 5 you had indexes and inside indexes there where types, pretty confusing
# Jul 10th 2018, 09:46 josbeir mostly use the cake plugin or elastica
# Jul 10th 2018, 09:46 josbeir its been a long time when i accessed ES rest methods directly
# Jul 10th 2018, 09:45 josbeir yep
# Jul 10th 2018, 09:45 james.phillips "Documents are the content within engines. The API allows you to create, update, and delete documents."
# Jul 10th 2018, 09:45 james.phillips Its the ES cloud trial so maybe it only lets you have one index called documents
# Jul 10th 2018, 09:44 josbeir nice, figures as connection extends the Elastica Client class :P
# Jul 10th 2018, 09:44 james.phillips thanks @lorenzo
# Jul 10th 2018, 09:44 lorenzo @james.phillips add a `'headers' => ['Authorization' => '....']` to your config
# Jul 10th 2018, 09:44 josbeir but not sure, it looks like a non-standard ES thingy
# Jul 10th 2018, 09:43 josbeir then documents is the index probably @james.phillips
# Jul 10th 2018, 09:43 neon1024 :thinking_face:
# Jul 10th 2018, 09:43 neon1024 Accessing it directly, does not
# Jul 10th 2018, 09:43 neon1024 The first one, by traversing the previous table, it picks up the conditions
# Jul 10th 2018, 09:43 neon1024 `$this->UserPermissions->Companies->find()` vs `$this->Companies->find()`
# Jul 10th 2018, 09:42 neon1024 Why the conditions are being passed over
# Jul 10th 2018, 09:42 neon1024 So i found my “other:” issue
# Jul 10th 2018, 09:42 james.phillips sdsadfas = engine name
# Jul 10th 2018, 09:42 josbeir or documents
# Jul 10th 2018, 09:42 josbeir no idea but i would think 'sdsadfas' is the index name?