Open
Description
Description
Search is not working with this simple configuration:
const testData = [
{
lvl0: "Zhuang Zi",
lvl1: "Chapter 2",
content: "昔者莊周夢為胡蝶,栩栩然胡蝶也。自喻適志與,不知周也。俄然覺,則蘧蘧然周也,不知周之夢為胡蝶與,胡蝶之夢為周與?周與胡蝶,則必有分矣。此之謂物化。",
url: "/zhuangzi-2#p269",
url_without_anchor: "/zhuangzi-2",
item_priority: 100,
comment: false,
}
]
const indexName = "zhuangzi-2";
const schema: CollectionCreateSchema = {
name: indexName,
fields: [
{ name: "lvl0", type: "string" },
{ name: "lvl1", type: "string" },
{ name: "content", type: "string", locale: "zh" }, // <--- !!!!
{ name: "url", type: "string" },
{ name: "url_without_anchor", type: "string" },
{ name: "item_priority", type: "int32" },
{ name: "comment", type: "bool" },
],
};
async function main() {
await typesenseClient.collections().create(schema);
await typesenseClient.collections(indexName).documents().import(testData);
const searchResult = await typesenseClient
.collections(indexName)
.documents()
.search({
q: "蝶",
query_by: "content",
});
console.log(searchResult.hits);
}
main();
Steps to reproduce
Repo for reproduction
https://github.com/dannylin108/typesense-bug-report
Expected Behavior
Should find the only document, which actually contains the character we were looking for.
Actual Behavior
Result is []
Metadata
Typesense Version: 0.27.1
OS: Linux
Metadata
Metadata
Assignees
Labels
No labels