-
Notifications
You must be signed in to change notification settings - Fork 27
Add index #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add index #37
Conversation
to use an ugly json encoding for the indexes
by removing add and remove functions as only update is required
update and delte functions of the repo were not tested and didn't work this is now fixed
these two operators are not very efficient so i'm not sure to keep them in the hashindex, but at least they are working
- move $data initialisation into concrete StoredIndex extensions - add constructor definition to IndexInterface to make sure it is compatible with the initialisation in Repository - completely abstract filesystem from HashIndex (constructor)
- removed operators '===' and '!==' as I don't think we can implement them with the current HashIndex data structure. (We could maybe write the type in the key to implement this) - change test accordingly - add inconsistent data test - simplify index generation from document files
use an array instead of an stdClass to store the data
+ fix tests for php5.3
|
I still have one problem with this approach: Before, it was possible to edit the values of the document from an external source and still have coherent results. This is not possible anymore when the query is using the index. I'm wondering how big of a problem it is.
thing left to do (maybe)
|
+ test regenerate function + refactor testFindByIndex
For me this was a major design decision and a benefit of Flywheel. I know indexes are opt-in right now which is good but I'd been keen to not lose that and still get the performance improvements. Can you think of another approach we could take? it might be impossible and I might be asking too much here. |
Hi @jamesmoss i'm so glad you merged my previous PR so fast. I started to implement indexes. but I still don't feel like the job is finished. I make this PR as a draft so you can give me your opinion.
I only did HashIndexes yet but I plan to make some more. I'm thinking for example about a FulltextIndex that could index words in strings.