yathit / ydn-db-fulltext

Full text search module for YDN-DB
30 stars 4 forks source link

must have "keyword" index #3

Closed astroanu closed 9 years ago

astroanu commented 10 years ago

I get this error. Here's my code


var schema = {
            stores: [{
                name: 'drugs',
                indexes: [{
                    keyPath: 'id'
                }]
            }],
            fullTextCatalogs: [{
                name: 'drugs',
                sources: [{
                    storeName: 'drugs',
                    keyPath: 'term',
                    weight: 1.0
                }]
            }]
        };

        var db = new ydn.db.Storage('nics', schema);
        db.search('term', 'jon').done(function(x) {
            console.log(x);
            db.get(x[0].storeName, x[0].primaryKey).done(function(top) {
                console.log(top);
            })
        });
yathit commented 10 years ago

You are using wrong way. Tour schema is wrong.

Query should be,

db. search('drugs', 'term')
astroanu commented 10 years ago

Just figured it out. Thanks anyway. This is a really good library. but lacks a detailed documentation.

yathit commented 10 years ago

Really? Have you read api on dev.yathit.com? On Jun 25, 2014 6:16 PM, "astroanu" notifications@github.com wrote:

Just figured it out. Thanks anyway. This is a really good library. but lacks a detailed documentation.

— Reply to this email directly or view it on GitHub https://github.com/yathit/ydn-db-fulltext/issues/3#issuecomment-47083420 .