Skip to content

fulltextsearch docstore does not clear when clear is called on a preloaded collection #188

Open
@gotenxds

Description

@gotenxds

[X] Bug report

Current behavior

When using autoload to load the DB and then calling clear on a loaded collection the fulltext docstore of that collection is not cleared.

I checked this for a newly loaded collection (that is loaded from the server) calling clear clears the fulltext docstore
but If I refresh (allowing the autoload feature to work) and then call clear, when I try to insert new data into the collection I get the error Field already added. in the insert method of the fullTextSearch, when I examine the docstore in that error I can see that it is still full

Edit:
After debugging the code a bit more, I see that loki does call clear on the fulltext search but the issue is that with autoLoad for some reason the _docs for the inverted_index is empty even but the actual inverted_index is not, not sure why this is happening

Expected behavior

calling collection.clear should clear the fulltext search for that collection as well. no matter how the collection was created.

image

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