Open mrDMG89 opened 1 month ago
This issue can also occur when using Simplified Chinese
I know why it's not showing up. The main reason is that the lunrjs (full-text search) component supports too few languages. When creating lunrFactory
function, unsupported languages are ignored, and the data key for inventedIndex
in lunr.Index
becomes an empty string
However, empty strings are ignored in the subsequent 'search' method, resulting in them not appearing in the result list
Add a fixed field to display
so that the key value pairs of inventedIndex
are not empty
function lunrFactory() {
return lunr(function () {
this.ref("id");
this.field("display");
for (let i = 0; i < props.items.length; i++) {
const item = props.items[i];
//const display = extractDisplay(item);
const display = "_" + extractDisplay(item);
this.add({ id: i, display });
}
});
}
Another solution:
const matches = index.value.search("*" + search.value + "*");
Replace with this code
let matches
if(search.value == ""){
//Show all Item
matches = index.value.search("");
}else{
matches = index.value.search("*" + search.value + "*");
}
This method can only achieve the use of unsupported languages for all names in the list, and cannot be used for full-text search, which still requires official support from Lunrjs. Attachment: Lunrjs supports languages
First Check
Homebox Version
0.13.0
What is the issue you are experiencing?
If location's name doesn't contain Latin characters, digits or symbols, this locations won't appear in "Parent location" field. As soon as any digit or symbol added to location's name it shows up in the list.
How can the maintainer reproduce the issue?
Name location just with cyrillic letters.
Deployment
Docker (Linux)
Deployment Details
Deployed on CasaOS.