Add support for list attributes in metadata#36
Open
pau-mensa wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've had this use case for quite a while now, where I've wanted to store list attributes in the metadata of documents. Since sqlite does not support list attributes I stored them as strings and managed my way around using
LIKEandOR, but this got to a point where it does not scale further.I implemented this solution that creates a
metadata_inverted.jsonper index, where, per each list attribute, the distinct elements as keys and the document ids where they are referenced as values are stored. During filtering time there are two new methodswhere_anyandwhere_allthat perform set-like operations on those list attributes.If you are interested in merging this I can tweak the PR and adapt it however you want, on the other hand, if you are not interested in it (too much code added, don't like the solution/implementation, conflicts with other stuff and I'm missing context) feel free to close it!