INNER CODE UNIT · Rust

new

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

    pub fn new(
        schema: &Valid<Schema>,
        root_types: EnumSet<OperationType>,
        index_memory_bytes: usize,
    ) -> Result<Self, IndexingError> {
        let start_time = Instant::now();

        // Register a custom analyzer with English stemming and lowercasing
        // TODO: support other languages
        let text_analyzer = TextAnalyzer::builder(SimpleTokenizer::default())
            .filter(LowerCaser)
            .filter(Stemmer::new(Language::English))
            .build();

        // Create the schema builder and add fields with the custom analyzer
        let mut index_schema = TantivySchema::builder();
        let type_name_field = index_schema.add_text_field(
            TYPE_NAME_FIELD,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…