Comments (2)
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.
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)
- Highlight exact search query HOT 1
- Score evaluation HOT 4
- Scoring items higher / grouping results HOT 2
- synonyms substitute HOT 1
- Sort by Length HOT 1
- How can i do it with post method? and mysql HOT 1
- install in nodejs HOT 1
- how do you select the matcing items? HOT 1
- dynamically adjusting json source HOT 8
- debug mode HOT 1
- hiding html comments HOT 2
- using a different UI HOT 2
- intelligently caching the JSON data HOT 2
- score handling HOT 2
- Updating your Books Object
- multiple occurrances of a highlight makes no diff HOT 1
- how to honor the matches in short entries greater than long entries? HOT 5
- which params should I play with? HOT 1
- updating the index in the middle of search HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fuzzysearch.