Querying and Indexing Multiple Elements Issues
TLDR 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.
Dec 15, 2022 (10 months ago)
Krish
06:49 AMKishore Nallan
07:19 AMdrop_tokens_threshold
)Krish
08:09 AMKishore Nallan
08:19 AMKishore Nallan
08:20 AMdrop_tokens_threshold
then it will more or less try to drop tokens for 2 token queries.Kishore Nallan
08:21 AMKrish
08:23 AMKrish
08:23 AMKishore Nallan
08:25 AMKrish
08:26 AMKishore Nallan
08:26 AMKrish
08:27 AMKrish
08:27 AMKrish
08:28 AMKishore Nallan
08:28 AMKrish
08:28 AMKrish
08:30 AMKishore Nallan
08:47 AMKrish
12:11 PMKishore Nallan
12:17 PMKrish
12:20 PMroger@W102TS3793:~/searchapp/typesense-server$ curl -H "X-TYPESENSE-API-KEY: RnVjazFuZzRzc2gwbDMh" "<http://localhost:3000/search?q=avi>"
{"facet_counts":[],"found":1,"hits":[{"document":{"end":193626,"id":"3124498306","keywords":"avio community driven monetization platform open source projects connect maintainers developers businesses tons typesense hope scotch give shot","start":112130,"title":"Build React Full-Text Instant Search App with Typesense - 10,000 Movies database","url":"<https://example.com>"},"highlights":[{"field":"keywords","matched_tokens":["avi"],"snippet":"<mark>avi</mark>o community driven monetization platform open source projects connect maintainers developers businesses tons typesense hope scotch give shot"}],"text_match":72341261125681150}],"out_of":6,"page":1,"request_params":{"collection_name":"videos","per_page":10,"q":"avi"},"search_cutoff":false,"search_time_ms":0}
Krish
12:20 PMKrish
12:20 PMroger@W102TS3793:~/searchapp/typesense-server$ curl -H "X-TYPESENSE-API-KEY: RnVjazFuZzRzc2gwbDMh" "<http://localhost:3000/search?q=avio> typesense"
roger@W102TS3793:~/searchapp/typesense-server$
Krish
12:22 PM"keywords":"avio community driven monetization platform open source projects connect maintainers developers businesses tons typesense hope scotch give shot"
Kishore Nallan
12:26 PM<http://localhost:3000/search?q=avi>
is proxying Typesense? I need the actual query made to Typesense.Kishore Nallan
12:28 PMKrish
12:29 PMconst videoSchema = {
'name': 'videos',
'fields': [
{ 'name': 'id', 'type': 'string', 'facet': false },
{ 'name': 'title', 'type': 'string', 'facet': true },
{ 'name': 'keywords', 'type': 'string', 'facet': false },
{ 'name': 'url', 'type': 'string', 'facet': true },
{ 'name': 'start', 'type': 'int32', 'facet': true },
{ 'name': 'end', 'type': 'int32', 'facet': true }
],
//'default_sorting_field': 'title'
}
if (typesense.collections('videos').exists()) {
const c = typesense.collections('videos').retrieve()
console.log('Exisitng collection found')
console.log('No. of records : ', (await c).num_documents)
return await typesense.collections('videos').documents().create(item)
}
And th eapi is invoked like so
app.get('/search', async(req, res) => {
const { q } = req.query;
try {
const searchResults = await lookup(q)
console.log('Search Results : ', searchResults)
res.send(searchResults)
} catch (err) {
console.error(err)
res.send(err)
}
});
Krish
12:30 PMKishore Nallan
12:31 PMKrish
12:31 PMKrish
12:41 PMKrish
12:43 PMKrish
01:06 PMKishore Nallan
01:09 PMTypesense
Indexed 2779 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.
Troubleshooting Typesense Setup and Understanding Facets and Keywords
Demitri encountered errors when exploring Typesense for the first time. Jason guided them through troubleshooting and discussed facets, keyword settings, and widget configurations. Helin shared a Python demo app and its source code to help Demitri with their project.
Querying with Not-in in Typesense
Masahiro inquired about using not-in queries in Typesense. Kishore Nallan explained how to conduct such queries by using the "-" operator in the query string, and assisted Masahiro with issues stemming from a high number of exclusion tokens. The problem was eventually resolved by switching to the `multi_search` endpoint.
Troubleshooting Issues with DocSearch Hits and Scraper Configuration
Rubai encountered issues with search result priorities and ellipsis. Jason helped debug the issue and suggested using different versions of typesense-docsearch.js, updating initialization parameters, and running the scraper on a Linux-based environment. The issues related to hits structure and scraper configuration were resolved.
Sorting Results in Typesense and Handling Errors
Ramees asks about sorting results by distance in Typesense, entering a list of strings as a field, and resolving an error with `fields` format. Kishore Nallan assists with these issues and advises on storing timestamps and proper authentication.