Skip to content

As a locker developer, I want to be able to index and search Locker data

nym edited this page Aug 12, 2011 · 8 revisions

Wireframes

TBD

Inspiration

Indexing

I can call a Locker API function to index any Locker JSON object to a flatfile index using the CLucene library

var search = require('lsearch');
var contacts = <JSON results of calling Locker API query of "/Me/contacts/allContacts", or your own list of Locker contact objects>
for (var i in contacts) {
    search.index('contact', contacts[i].id, contacts[i].body, function(err) {});
}

Searching

I can call a Locker API function to search a single service type (e.g. index file) using the Query Parser Syntax and get JSON results back

var search = require('lsearch');
search.query('contact', 'firstname:eric', 0, 10, function(err, results) {
    // do cool stuff with data in results
});

I can call a Locker API function to search all Locker service types (e.g. index files) using the Query Parser Syntax and get JSON results back

var search = require('lsearch');
search.query('*', 'firstname:eric', 0, 10, function(err, results) {
    // do cool stuff with data in results
});

User

I can use the existing search app to search across my entire locker, using the new CLucene search API, and see basic results in a raw JSON format.

Clone this wiki locally