INNER CODE UNIT · Rust

search

apollographql/apollo-mcp-server · crates/apollo-schema-index/src/lib.rs:369

    pub fn search<I>(
        &self,
        terms: I,
        options: Options,
    ) -> Result<Vec<Scored<PathNode>>, SearchError>
    where
        I: IntoIterator<Item = String>,
    {
        let searcher = self.inner.reader()?.searcher();
        let mut root_paths: Vec<Scored<PathNode>> = Default::default();
        let mut scores: IndexMap<String, f32> = Default::default();

        let query = self.query(terms);
        debug!("Index query: {:?}", query);

        // Get the top GraphQL schema types matching the search terms
        let top_docs = searcher.search(&query, &TopDocs::with_limit(100).order_by_score())?;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…