Node.Js Full Text Search (*) Problem

// my code

app.get('/api/search', function (req, res) {

    // name = steven
    var SearchQuery = couchbase.SearchQuery;
    var query = SearchQuery.new('name', SearchQuery.term("ste")).fields("*");
    bucket.query(query, function(err, response, meta) {
        res.json(res);
        // not hits
    });

});

thank you.

Hey @olcayusta,

Could you elaborate on the issue you’ve encountered?

Cheers, Brett

I use http full text search api with postman, no problem.

But Node.js Sdk;

You should use wildcard query if you need * handled.

LIKE is slowly, not the solution.

You can either use a SearchQuery.prefix (and then get rid of the * from your query), if all you’re interested in doing is an autocomplete, rather than SearchQuery.term.

Alternatively, as @avsej said - you should use a SearchQuery.wildcard instead. That is not a LIKE as per N1QL.