-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
routing_missing_exception when update/delete data. #114
Comments
When you have declared a parent/child relationsship you must provide a routing parameter when you call The code should look like this: $chapter->update(true, null, ['routing' => $book->id]); See https://www.elastic.co/guide/en/elasticsearch/guide/current/indexing-parent-child.html on more details about this. And http://www.yiiframework.com/doc-2.0/yii-elasticsearch-activerecord.html#update%28%29-detail for the description of the |
@cebe : How can I get a routing value of a record in this extension? For PK's there is $model->getPrimaryKey(). |
the routing value usually is the PK. At least as far as I know. Is that not the case for you? |
I got it. Now I need to find chapters by the Routing value. In ElasticSearch I use the next code to search by its Routing value:
In my Yii code I'm trying to do this as following:
This will return NULL. Can anyone help me? |
Could be related to #99. |
Hi, I have a problem, I want to query child condition, I fave found it only use query() or where(), but they cannot be used at the same time. What should i do? |
Can't help you with child conditions specifically, because I've never used them. However, public function testQueryWithWhere()
{
// make sure that both `query()` and `where()` work at the same time
$query = new Query();
$query->from('query-test', 'user');
$query->where(['status' => 2]);
$query->query(['term' => ['name' => 'userb']]);
$result = $query->search($this->getConnection());
$total = is_array($result['hits']['total']) ? $result['hits']['total']['value'] : $result['hits']['total'];
$this->assertEquals(1, $total);
} This definitely works. |
Yes, Thank you , I update my package, that |
Hello guys,
What steps will reproduce the problem?
When I go to my website to a CRUD and want to update a row of a chapter, and press on "UPDATE" to save the data, there will come an routing_missing_exception error of ElasticSearch. For deleting it is exactly the same thing.
What's expected?
Saved data, redirect to the index page.
What do you get instead?
ElasticSearch error: Routing_missing_exception
Screenshot: http://i68.tinypic.com/6gzclv.png
Additional info
I'm using parent-child relationship. I got
books
withchapters
I can create, update and delete a book, without any errors. So I only got this when I try to update/delete a chapter.
My code to create a chapter:
My code to update a chapter:
Kind Regards,
Arjan
The text was updated successfully, but these errors were encountered: