`_eval` Functionality on String Parameters
TLDR Tulika reported trouble using _eval
on string parameters. Harpreet identified the issue as a bug fixed in version 0.26 and guided Tulika to the release candidate build.
1
Oct 25, 2023 (1 month ago)
Tulika
06:50 AM_eval
on multiple parameters with datatype: int 32 , but not able to do the same with string parameters in _eval
. Detailed example below->search_parameters = {
'q': 'Harry',
'query_by': 'title',
'per_page': '100',
'sort_by': '_eval(publication_year:[2007,2001]):desc,_text_match:desc'
}
this is working fine as the hits with publication year 2007 and 2001 comes up in the beginning of the hits.
search_parameters = {
'q': 'Harry',
'query_by': 'title',
'per_page': '100',
'sort_by': '_eval(title:[Harry Potter and the Cursed Child,Harry Potter and the Prisoner of Azkaban]):desc,_text_match:desc'
}
but this is showing error ->
typesense.exceptions.ObjectNotFound: [Errno 404] Could not find a field named
_eval(title in the schema for sorting.
publication_year is of int32 datatype
title is of string datatype
does anybody know how can I solve this?.
Oct 26, 2023 (1 month ago)
Tulika
06:51 AMHarpreet
08:15 AMHarpreet
08:17 AM'sort_by': '_eval(title:Harry Potter and the Cursed Child):desc,_text_match:desc'
Tulika
11:10 AMTulika
11:12 AM'sort_by': '_eval(title:Harry Potter and the Cursed Child):desc,_text_match:desc'
this works fine.
1
Harpreet
11:13 AMTulika
11:16 AMHarpreet
11:17 AMTulika
11:22 AMHarpreet
11:25 AMTulika
11:25 AMHarpreet
11:26 AMTypesense
Indexed 3015 threads (79% resolved)
Similar Threads
Methods for Fetching, Querying, and Modifying Collections in Typesense
Bill inquired about performing OR queries, querying empty arrays and modifying collections in Typesense. Kishore Nallan explained the current limitations and provided workarounds and recommendations for each case. The conversation also touched upon the usage of cache in Typesense and the workings of the _eval function.
Document Weighting and Sorting Discussion
SamHendley asked how to weight a document based on age and offered a sorting method. Jason clarified the method and suggested an RC for use. SamHendley tested and confirmed the solution. User Kishore Nallan assisted when an error occurred with a new feature.
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.
Docsearch Scrapper Metadata Configuration and Filter Problem
Marcos faced issues with Docsearch scrapper not adding metadata attributes and filtering out documents without content. Jason helped fix the issue by updating the scraper and providing filtering instructions.
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.