Evaluate query, and collection feedback
| 84 | |
| 85 | //! Evaluate query, and collection feedback |
| 86 | int EqualQuery::evaluate() { |
| 87 | TaskPtrList tasks(tasks_.begin(), tasks_.end()); |
| 88 | int code = executor()->execute_tasks(tasks); |
| 89 | if (code == 0) { |
| 90 | // one result or nothing |
| 91 | for (auto &task : tasks_) { |
| 92 | if (task->hit()) { // Pick first hit document, drop others |
| 93 | proto::Document *doc = response_->mutable_document(); |
| 94 | doc->set_primary_key(primary_key()); |
| 95 | code = fill_forward(task->forward(), doc); |
| 96 | if (code != 0) { |
| 97 | LOG_WARN("Fill forward failed. code[%d] what[%s]", code, |
| 98 | ErrorCode::What(code)); |
| 99 | } |
| 100 | break; |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | return code; |
| 105 | } |
| 106 | |
| 107 | int EqualQuery::finalize() { |
| 108 | return 0; |
nothing calls this directly
no test coverage detected