Giter Club home page Giter Club logo

Comments (2)

jeancroy avatar jeancroy commented on July 30, 2024

So the main complication is that a lot of data is matched by position index in array.

So a temporary removal could be

this.source[idx] = null
this.index[idx] = null
this.store => iterate over all field to remove idx
this.index_map => get unique id of item to remove, then invalidate this using -1, null ?

Then a lot of null check and invalid check.

A more complete removal would require to map all old position to new position.
I'm not sure if this is worth the trouble if rebuilding the index take less than say 200ms
Even if rebuilding the index take like a full second I'd invest in a low priority background worker instead of the complexity of patching the index to new position.

The add() method I can see useful where a client is being drip fed documents.
The remove() I'm not sure of the use case. I suspect it's dependant of the serialization issue.

In any case, I'm not sure the benefit of having this in library vs a soft delete by the user of library.

I'm also working on the assumption that the index can be rebuilt on demand almost instantaneously, I just think it's a waste to recompute it on each search (but many library do pay that cost).
In case of instant search one keystroke = one search.

from fuzzysearch.

jeancroy avatar jeancroy commented on July 30, 2024

As I said right now I gravitate invalidate & rebuild cache.
But I'm interested in your rebuild time.
And if they are unacceptable I'll see if it's worth to properly patch the cache.

from fuzzysearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.