It is very easy to find the letters at the beginning of a line. You just need a view that emits the string you want to find as a key. Assuming that user input is stored in a variable q, you call this view with the startkey=qand parameters endkey=q+"\ufff0".
, . - , q. ( , , @titanoboa, "" .)
(, " Colbert" "co" ), :
function(doc) {
if (doc.title) {
var words = {};
doc.title.replace(/\w+/g, function(word) {
words[word.toLowerCase()] = true;
});
for (w in words) {
emit(w, doc);
}
}
}
, . , couchdb-lucene.