Troubleshooting Typo Highlighting in Search Queries
TLDR Stefan queried "chews" and "Roche", despite having a typo distance of 4, was highlighted. Kishore Nallan requested to test on v0.20 RC. Random results like "Sachets" and "Lachesca" were also highlighted. On single record query, highlighting works. Kishore Nallan assured to address this issue in the pending release.
1
Apr 22, 2021 (31 months ago)
Stefan
11:50 AMKishore Nallan
11:56 AMStefan
11:56 AMStefan
11:56 AMStefan
11:56 AMStefan
11:56 AMKishore Nallan
11:57 AMStefan
12:22 PMStefan
12:22 PMKishore Nallan
12:24 PMStefan
12:29 PMStefan
12:29 PMfrom typing import List
from external_services.typesense_cloud import typesense_client
from database_connection import db
import models as m
schema = {
'name':
'test',
'fields':
[
{
'facet': False,
'name': 'id',
'optional': False,
'type': 'string'
},
{
'facet': False,
'name': 'name',
'optional': False,
'type': 'string'
},
],
}
def bootstrap_data():
# typesense_client.collections['test'].delete()
typesense_client.collections.create(schema)
products: List[m.Product] = db.session.query(m.Product).all()
documents = [{"id": "1", "name": "Roche"}]
typesense_client.collections['test'].documents.import_(documents, {'action': 'upsert', 'batch_size': 100})
# typesense_client.collections['ingredients_v2'].documents.import_(documents, {'action': 'create'})
# bootstrap_data()
# res = typesense_client.collections['test'].retrieve()
# pprint(res)
search_requests = {
'searches': [{
'collection': 'test',
'q': 'chews',
}, ]
}
res = typesense_client.multi_search.perform(search_requests, {
'query_by': 'name',
})
print(res)
Stefan
12:37 PMKishore Nallan
12:38 PMStefan
12:39 PMStefan
12:39 PMStefan
12:40 PMStefan
12:40 PMKishore Nallan
12:41 PMStefan
12:41 PMKishore Nallan
12:42 PMKishore Nallan
12:43 PMStefan
12:48 PMStefan
12:48 PMKishore Nallan
01:03 PM1
Typesense
Indexed 2776 threads (79% resolved)
Similar Threads
Phrase Search Relevancy and Weights Fix
Jan reported an issue with phrase search relevancy using Typesense Instantsearch Adapter. The problem occurred when searching phrases with double quotes. The team identified the issue to be related to weights and implemented a fix, improving the search results.
Resolving Typesense Result Issue in Document Collection Queries
Mike was encountering errors when searching for specific query in their Typesense document collection. Jason suggested it may be due to the `drop_tokens_threshold` setting. There was a misunderstanding but after further explanation from Jason, Mike understood and decided to continue the conversation via email.
Utilizing Vector Search and Word Embeddings for Comprehensive Search in Typesense
Bill sought clarification on using vector search with multiple word embeddings in Typesense and using them instead of OpenAI's embedding. Kishore Nallan and Jason informed him that their development version 0.25 supports open source embedding models. They also resolved Bill's concerns regarding search performance, language support, and limitations in the search parameters.
Querying and Indexing Multiple Elements Issues
Krish queried fields with multiple elements, which Kishore Nallan suggested checking `drop_tokens_threshold`. Krish wished to force OR mode for token, but Kishore Nallan admitted the feature was missing. Krish was able to resolve the issue with url encoding.
Query on "weighted_score" & Issue with Synonym Highlighting
Stefan asked about "weighted_score" field and reported a possible synonym highlighting issue. Kishore Nallan clarified the use of "weighted_score". The possible synonym issue is still being investigated.