(
&mut self,
repo_id: RepoId,
topic_id: &ExternalId,
topic: &RepoTopic,
)
| 566 | } |
| 567 | |
| 568 | pub fn remove_topic( |
| 569 | &mut self, |
| 570 | repo_id: RepoId, |
| 571 | topic_id: &ExternalId, |
| 572 | topic: &RepoTopic, |
| 573 | ) -> Result<()> { |
| 574 | self.check_can_update(repo_id)?; |
| 575 | |
| 576 | self.indexer |
| 577 | .remove_synonyms(&self.client, repo_id, topic_id, topic)?; |
| 578 | |
| 579 | let meta = &topic.metadata; |
| 580 | let mut searches = vec![]; |
| 581 | for synonym in meta.synonyms() { |
| 582 | let search = Search::parse(&synonym.name)?; |
| 583 | if search.is_empty() { |
| 584 | continue; |
| 585 | } |
| 586 | searches.push(search); |
| 587 | } |
| 588 | |
| 589 | let entry = topic.to_search_entry(); |
| 590 | self.indexer |
| 591 | .remove_searches(&self.client, repo_id, &entry, searches.iter())?; |
| 592 | self.remove(repo_id, topic_id)?; |
| 593 | |
| 594 | Ok(()) |
| 595 | } |
| 596 | |
| 597 | pub fn repo(&self, repo_id: RepoId) -> Result<core::Repo> { |
| 598 | self.client.repo(repo_id) |
no test coverage detected