Closed Kimeiga closed 9 months ago
I think it could be because typesense is prefix matching as when I search for a a character, it doesn't give me any results that have that character in the middle or end of words. This is a big problem because if you want to solve it for the individual character case you can add spaces between each character but then you can no longer match the whole word if you supplied the whole word as a search input. is there anything I can do to search without only prefix matching?
Nvm solved with using infix #393
let cedictSchema = {
'name': 'cedict',
'fields': [
{ 'name': 't', 'type': 'string', "infix": true },
{ 'name': 's', 'type': 'string', "infix": true },
{ 'name': 'p', 'type': 'string', "infix": true },
{ 'name': 'd', 'type': 'string', "infix": true }
]
};
let searchParameters = {
'q': '汉',
'query_by': '*',
'infix': 'always'
};
Description
I'm using typesense to query the cedict which is a chinese dictionary, and it uses pipes ("|") to delimit traditional/simplified character pairs in the definitions.
Like this: 余 余 [yu2] /(literary) I; me/variant of 餘|余[yu2]/
When I search a simplified character, nothing comes up because the pipe character is preventing the simplified character from being matched. When I replace all pipe characters in the definitions with spaces, the simplified characters get matched as normal
Steps to reproduce
Download cedict_ts.u8
Expected Behavior
Actual Behavior
Metadata
Typesense Version: 0.25.2
OS: WSL2 Ubuntu 22 LTS