Closed jacoscaz closed 7 years ago
Would registerIndex create a new index or use an existing one? It would be good to use an existing one to benefit from the leveldb ecosystem.
Ah think I see, you do mean an existing one, but it needs to be registered to match keys during the joins? I think I need to think more about this and play with search-index
to contribute better to the conversation :) The main use case I was thinking of was to reuse a search index with a quadstore instance.
@jmatsushita have a look at https://github.com/jacoscaz/node-quadstore/blob/indexes/test/quadstore.js#L672 . It's a basic demonstration of the api I was thinking about. The test implements an index that would take care of #39 . What do you think?
@jmatsushita ?
See pull request #42
Closing, available on NPM in quadstore@2.2.0-alpha .
What if someone requires additional indexes for context-specific queries? How can
quadstore
support extensions?Additional methods
registerIndex(String indexName, Function keyGenerator)
indexName
- name of index to be createdkeyGenerator
- function that generates an index key from a quadqueryIndex(String indexName, Object opts)
andqueryIndexStream(String indexName, Object opts)
indexName
- name of index to be queriedopts
- query optionsopts.start
- leveldb'sgte
minusindexName
opts.end
- leveldb'slte
minusindexName
Other stuff
store._delimiter
andstore._boundary
public