Hybrid Search with Multiple Keyword Fields in the Book Store Schema
TLDR Akash wanted to use hybrid search on multiple keyword fields and inquired how to define embedding field. Kishore Nallan clarified there can only be one embedding field and suggested referring to certain documents.
Oct 16, 2023 (1 month ago)
Akash
11:27 AM "searches": [
{
"query_by": "product_name,embedding",
"q": "desktop copier",
"collection": "products",
"prefix": "false",
"exclude_fields": "embedding",
"per_page": 2
}
Kishore Nallan
11:29 AMAkash
11:33 AMAkash
11:35 AMKishore Nallan
11:41 AMhttps://typesense.org/docs/0.25.1/api/vector-search.html#index-embeddings
Akash
11:50 AM'name': collection_name,
'fields': [
{'name': 'bookId', 'type': 'int32','facet': True},
{'name': 'id', 'type': 'string'},
{'name': 'isbn', 'type': 'string','facet': True,'optional':True},
{'name': 'title', 'type': 'string'},
{'name': 'slug', 'type': 'string'},
{'name': 'isOutOfStock', 'type': 'string', 'facet': True},
{'name': 'author', 'type': 'string', 'facet': True},
{'name': 'bookCondition', 'type': 'string[]', 'facet': True, 'optional':True},
{'name': 'subject', 'type': 'string', 'facet': True, 'optional':True},
{'name': 'publication','type': 'string', 'facet': True,'optional':True},
{'name': 'category', 'type': 'string', 'facet': True},
{'name': 'qty', 'type': 'int32'},
{'name': 'bookDescription', 'type': 'string', 'optional':True},
{'name': 'binding', 'type': 'string', 'facet': True},
{'name': 'language', 'type': 'string', 'facet': True},
{'name': 'keywords', 'type': 'string', 'facet': True, 'optional':True},
{'name': 'bookType', 'type': 'int32', 'facet': True},
{'name': 'iDate', 'type': 'int32'},
{'name': 'parentCategory', 'type': 'string', 'facet': True},
{'name': 'num_is_out_of_stack', 'type': 'int32'},
{'name': 'uDate', 'type': 'int32'},
{'name': 'mrp', 'type': 'int32', 'facet': True},
{'name': 'price', 'type': 'int32', 'facet': True},
{'name': 'discounPercent', 'type': 'int32', 'facet': True, 'optional':True},
{'name': 'cashbackPercent', 'type': 'int32', 'facet': True, 'optional':True},
{'name': 'agedGroup', 'type': 'string', 'facet': True , 'optional':True},
{'name': 'imageUrl', 'type': 'string', 'facet': False},
{'name': 'categorySuggestion', 'type': 'string', 'facet': False , 'optional':True},
{'name': 'categoryPathId', 'type': 'string[]', 'facet': False,'optional':True},
],
"symbols_to_index": ["(", ")", "+", "?" ],
'default_sorting_field': 'bookId'
} this is book store schema i want to embeded title , categorySuggestion
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Hybrid Search and Auto Embedding in Typesense
Md inquired about hybrid search and auto embedding. Jason explained how to use it and clarified the software version compatibility. Md confirmed v25 works well.
Understanding Hybrid Search with Own Embedding Field
Alain inquired about hybrid search functionality. Jason clarified that `vec` is not necessary in `query_by` for external embeddings. Alain agreed to further explore with a multisearch POST method.
Issue Searching Fields Other Than Embedding
Akash shared a book schema and search parameters but noted a problem in searching any field other than 'embedding'. Jason requested for a minimal reproducible example.