Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 36A8817739 for ; Tue, 3 Feb 2015 15:13:12 +0000 (UTC) Received: (qmail 90141 invoked by uid 500); 3 Feb 2015 15:13:10 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 89993 invoked by uid 500); 3 Feb 2015 15:13:10 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 88949 invoked by uid 99); 3 Feb 2015 15:13:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2015 15:13:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 211FCE076F; Tue, 3 Feb 2015 15:13:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: robertkowalski@apache.org To: commits@couchdb.apache.org Date: Tue, 03 Feb 2015 15:13:29 -0000 Message-Id: <61ed2450a236432083820bcabc0f3922@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [22/50] [abbrv] couchdb-mango git commit: Attempt to retrieve indexes from cache Attempt to retrieve indexes from cache BugzID: 42707 Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/c61576c3 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/c61576c3 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/c61576c3 Branch: refs/heads/master Commit: c61576c3cb44ee43a68764dbde7837edce821be7 Parents: 6f661f1 Author: Adam Kocoloski Authored: Thu Dec 11 14:32:48 2014 -0500 Committer: Adam Kocoloski Committed: Thu Dec 11 16:19:44 2014 -0500 ---------------------------------------------------------------------- src/mango_idx.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/c61576c3/src/mango_idx.erl ---------------------------------------------------------------------- diff --git a/src/mango_idx.erl b/src/mango_idx.erl index 4a3cf83..c1bbe4c 100644 --- a/src/mango_idx.erl +++ b/src/mango_idx.erl @@ -7,6 +7,7 @@ -export([ list/1, + recover/1, new/2, validate/1, @@ -36,6 +37,10 @@ list(Db) -> + {ok, Indexes} = ddoc_cache:open(Db, ?MODULE), + Indexes. + +recover(Db) -> {ok, DDocs0} = mango_util:open_ddocs(Db), Pred = fun({Props}) -> case proplists:get_value(<<"language">>, Props) of @@ -45,9 +50,9 @@ list(Db) -> end, DDocs = lists:filter(Pred, DDocs0), Special = special(Db), - Special ++ lists:flatmap(fun(Doc) -> + {ok, Special ++ lists:flatmap(fun(Doc) -> from_ddoc(Db, Doc) - end, DDocs). + end, DDocs)}. new(Db, Opts) ->