Skip to content

Conversation

@drewzhao
Copy link

@drewzhao drewzhao commented May 13, 2025

Change Summary

Typesense has supported since v24: https://typesense.org/docs/28.0/api/collections.html#notes-on-indexing-common-types-of-data

When using the typesense-docsearch-scraper , enabled_nested_fields is ignored.

This PR makes sure the "enabled_nested_fields" is read and effective when creating a collection.

PR Checklist

@drewzhao
Copy link
Author

drewzhao commented May 13, 2025

Hi Team Could you please help review this PR?

When using llamaindex with typesense, a nested metadata field is required. Nested fields is already supported by typesense. I hope that I can leverage the existing typesense-docsearch-scraper when creating the nested fields.

Thanks.

@jasonbosco
Copy link
Member

Thank you for the PR!

@jasonbosco jasonbosco merged commit 02a55a1 into typesense:master Jun 16, 2025
1 check passed
@jasonbosco
Copy link
Member

I've published this in 0.12.0.rc12. Could you give it a shot and let me know how it goes?

@drewzhao
Copy link
Author

I've published this in 0.12.0.rc12. Could you give it a shot and let me know how it goes?

@jasonbosco Tested with 0.12.0.rc12, it's working perfectly. 👍

The returned schema from "/collections/<collection_name>' contained the nested fields.

Here's an excerpt from my docsearch definition:

        { "name": "document_meta", "type": "object", "optional": true },
        { "name": "document_meta.section", "type": "string", "locale":"zh", "facet": true, "optional": true },
        { "name": "document_meta.difficulty_level", "type": "string", "facet": true, "optional": true },
        { "name": "document_meta.last_updated", "type": "string", "optional": true },
        { "name": "document_meta.author", "type": "string", "locale":"zh", "facet": true, "optional": true },
        { "name": "document_meta.category", "type": "string", "locale":"zh", "facet": true, "optional": true },
        { "name": "content_info", "type": "object", "optional": true },
        { "name": "content_info.word_count", "type": "int32", "optional": true },
        { "name": "content_info.reading_time", "type": "int32", "optional": true },
        { "name": "content_info.has_code_examples", "type": "bool", "optional": true },
        { "name": "page_attributes", "type": "object", "optional": true },
        { "name": "page_attributes.template_type", "type": "string", "facet": true, "optional": true },
        { "name": "page_attributes.product_version", "type": "string", "facet": true, "optional": true },
        { "name": "page_attributes.api_endpoints", "type": "string[]", "optional": true },

@jasonbosco
Copy link
Member

Awesome, thank you for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants