Skip to content

After upgrade to 0.8 search produces inconsistent results (0.7 works fine) #517

@z88kat

Description

@z88kat

Hi,

When I upgrade flexsearch from 0.7 to 0.8 my numeric search now produces too many results. From my experiments this is what I have found out.

Search Term: "9941"

Indexed Data:

0 "Call Sammy on 9944"
1 "Call Sammy on 9944343432"
2 "Call Jimmy on 9941343432"
3 "Call Jimmy on 9941"

Results:

0,1,2,3

All 4 result are returned. This makes no sense and is NOT the behaviour for version 0.7 which only returns entries 2 & 3

The problem appears to concern numeric search whereby it seems the last digital is ignored on the search term. For example:

Search Term --> What appears to be queried
9941 --> 994
99412 --> 9941
994123 --> 99413
X-9941-X --> 994 (yep, here too)

Just to mention again. This DOES NOT happen with 0.7.

The result is we now get 50 contacts returned instead of 3 which we get with 0.7 when searching with numbers.

This might be solved with a configuration change, but I tried everything and cannot get the old behaviour back.

Here is my configuration:

const options = {
    tokenize: "full",
    threshold: 1,
    optimize: true,
    resolution: 9,
    depth: 3,
    language: "en", 
    stemmer: true,
    document: {
        worker: true,
        id: "id", 
        index: ["document_id", "title", "content"],
        store: ["document_id", "title", "contact_id"]
    }
};

document.search({
            query: "9941",
            enrich: true,
        });

Any help would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions