Searching for numbers
When I search for a field which contains a number, the result is an empty array, I feel that there must be a very clear point that I am missing, could you explain the behaviour? Thank you very much.
const test = [
{
data: {
id: 0,
name: "foo",
val: 1
}
},
{
data: {
id: 1,
name: "bar",
val: 2
}
}
]
const index = new FlexSearch({
async: true,
doc: {
id: "data:id",
field: ["data:name", "data:val"]
}
});
index.add(test);
index
.search(1, {
field: "data:val"
})
.then(result => {
console.log(result);
//returns empty array
});
index
.search("bar", {
field: "data:name"
})
.then(result => {
console.log(result);
//returns the object it found
});
having similar issue . trying to store ip addresses + masks, for example 10.10.10.10/24 full range for some reason cant get match properly if giving exact ip from that range .
Same here
I'm still facing this issue, unable to search for numbers ! Did anyone find a solution to this yet? @machado-r @ViljarVoidula @alisomay ? Any updates regarding this @ts-thomas?
@maazkabir Sorry for replying 6 months later. I did not find a solution so I switched to Fuse.Js.
I also have the problem. I'm using another field that I built from the number: a string with a symbol to make it searchable.
It's not perfect but it's a temporary workaround.
@ts-thomas Maybe version 0.7.0 will solve the problem?
Please use a custom "encode" function which allows special chars like "." or "/"