Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 65155 invoked from network); 21 Jan 2011 19:46:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jan 2011 19:46:38 -0000 Received: (qmail 93550 invoked by uid 500); 21 Jan 2011 19:46:36 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 93474 invoked by uid 500); 21 Jan 2011 19:46:36 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 93465 invoked by uid 99); 21 Jan 2011 19:46:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jan 2011 19:46:36 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.210.180] (HELO mail-iy0-f180.google.com) (209.85.210.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jan 2011 19:46:28 +0000 Received: by iyj21 with SMTP id 21so2123808iyj.11 for ; Fri, 21 Jan 2011 11:46:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.226.7 with SMTP id iu7mr1289514icb.198.1295639165015; Fri, 21 Jan 2011 11:46:05 -0800 (PST) Received: by 10.42.241.134 with HTTP; Fri, 21 Jan 2011 11:46:04 -0800 (PST) In-Reply-To: <4D39C971.6020809@cloudant.com> References: <4D39C971.6020809@cloudant.com> Date: Fri, 21 Jan 2011 17:46:04 -0200 Message-ID: Subject: Re: Doubts with multiple keys! From: Fabio Batalha Cunha dos Santos To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf3054a0c1301731049a60805d X-Virus-Checked: Checked by ClamAV on apache.org --20cf3054a0c1301731049a60805d Content-Type: text/plain; charset=ISO-8859-1 Hi Dave, That's a great news... I will re-factor some view to improve the index files. Many Thanks, *Fabio Batalha C. Santos* Colegiado SciELO www.scielo.org FAPESP - CNPq - BIREME - FapUNIFESP On Fri, Jan 21, 2011 at 3:59 PM, David Hardtke wrote: > Hi Fabio, > > I'm assuming the your "value" is the document that you want to retrieve. > There is no need to include the document in the view result directly. Your > value can be null. When you retrieve the view you can add include_docs=true > to the query and it will append the document to your results. > > Dave > > > > On 01/21/11 09:39, Fabio Batalha Cunha dos Santos wrote: > >> Now that I know that this is the only way to access same content using >> different fields "keys", I have one more question. >> >> For example: >> >> I have other view (VIEW A) that bring a lot of info, this view have 3 >> keys, >> "Subject", "collection", "title" this view could return something around >> 300.000 registers "depends on the query". If I want to priorize the search >> for collection instead of subject I must create a new view (VIEW B) >> changing >> the order of the key, that is it? probably yes! >> >> (VIEW A) >> >> {"id":"e5b72d48-5d18-43a8-aef9-27bd46f93fba","key":["Agricultural >> Sciences","scl","Scientia >> >> Agricola"],"value":{"collection":"scl","issn":"0103-9016","title":"Scientia >> Agricola","subject":["AGRONOMIA"],"publisher":{"_":"S\u00e3o Paulo - >> Escola Superior de Agricultura \"Luiz de >> Queiroz\""},"insert_date":"19981016"}}, >> {"id":"317c2636-7e56-422e-9720-f351568acc7f","key":["Agricultural >> Sciences","scl","Summa >> >> Phytopathologica"],"value":{"collection":"scl","issn":"0100-5405","title":"Summa >> Phytopathologica","subject":["AGRONOMIA; FITOPATOLOGIA; >> FITOSSANIDADE"],"publisher":{"_":"Grupo Paulista de >> Fitopatologia"},"insert_date":"20061011"}}, >> {"id":"ea6d6684-a638-4ea6-8035-982ed8dd7326","key":["Agricultural >> Sciences","scl","Tropical Plant >> >> Pathology"],"value":{"collection":"scl","issn":"1982-5676","title":"Tropical >> Plant Pathology","subject":["FITOPATOLOGIA"],"publisher":{"_":"Sociedade >> Brasileira de Fitopatologia"},"insert_date":"20080422"}}, >> {"id":"baadd506-9a83-4645-9dba-3c766a7a51b8","key":["Agricultural >> >> Sciences","ven","Agroalimentaria"],"value":{"collection":"ven","issn":"1316-0354","title":"Agroalimentaria","subject":["CIENCIAS >> ECON\u00d3MICAS Y SOCIALES, SOCIOLOG\u00cdA, AGRICULTURA, >> NUTRICI\u00d3N, ECONOM\u00cdA AGROALIMENTARIA, CONSUSMO DE ALIMENTOS, >> SEGURIDAD ALIMENTARIA, SISTEMA ALIMENTARIO, >> ALIMENTACI\u00d3N"],"publisher":{"_":"Centro de Investiagciones >> Agroalimentarias (CIAAL), Facultad de Ciencias Econ\u00f3micas y >> Sociales, Universidad de los Andes"},"insert_date":"20030407"}}, >> {"id":"02c01a5c-8986-4533-b390-f8a874ba2e8d","key":["Agricultural >> >> Sciences","ven","Bioagro"],"value":{"collection":"ven","issn":"1316-3361","title":"Bioagro","subject":["AGRONOM\u00cdA, >> BOT\u00c1NICA, ZOOLOG\u00cdA"],"publisher":{"_":"Decanato de >> Agronom\u00eda de la Universidad Centroccidental \"Lisandro Alvarado\" >> (UCLA)"},"insert_date":"20050310"}}, >> {"id":"edcf204d-b219-43ba-b565-d6c55f940e40","key":["Agricultural >> Sciences","ven","Revista de la Facultad de >> >> Agronom\u00eda"],"value":{"collection":"ven","issn":"0378-7818","title":"Revista >> de la Facultad de Agronom\u00eda","subject":["AGRICULTURA Y >> GANADER\u00cdA TROPICAL"],"publisher":{"_":"Facultad de >> Agronom\u00eda. Universidad del Zulia "},"insert_date":"20030715"}}, >> {"id":"b9963ad8-7454-4085-a980-375ccacb9fef","key":["Agricultural >> Sciences","ven","Zootecnia >> >> Tropical"],"value":{"collection":"ven","issn":"0798-7269","title":"Zootecnia >> Tropical","subject":["GANADER\u00cdA"],"publisher":{"_":"Instituto >> Nacional de Investigaciones Agricolas INIA, Maracay, Venezuela. >> "},"insert_date":"20041115"}}, >> {"id":"c2c64c77-712e-4e4b-a24d-0c9e81790512","key":["Agropecuarias >> Sciences","cub","Cultivos >> >> Tropicales"],"value":{"collection":"cub","issn":"0258-5936","title":"Cultivos >> Tropicales","subject":["INVESTIGACIONES >> AGR\u00cdCOLAS"],"publisher":{"_":"Ediciones >> INCA"},"insert_date":"20090424"}}, >> {"id":"e20d515c-e912-42c1-979f-1b1058cc499e","key":["Applied Social >> Sciences","chl","ARQ >> (Santiago)"],"value":{"collection":"chl","issn":"0717-6996","title":"ARQ >> (Santiago)","subject":["ARQUITECTURA"],"publisher":{"_":"Ediciones >> ARQ"},"insert_date":"20011212"}}, >> {"id":"50930791-6632-4fe4-a750-53b6fb64709e","key":["Applied Social >> Sciences","chl","Bolet\u00edn del Museo Chileno de Arte >> >> Precolombino"],"value":{"collection":"chl","issn":"0718-6894","title":"Bolet\u00edn >> del Museo Chileno de Arte >> Precolombino","subject":["ANTROPOLOGIA"],"publisher":{"_":"Museo >> Chileno de Arte Precolombino"},"insert_date":"20081105"}}, >> {"id":"6ec2ffbd-6539-4b66-bbd1-cffae01829c7","key":["Applied Social >> Sciences","chl","Chungar\u00e1 >> >> (Arica)"],"value":{"collection":"chl","issn":"0717-7356","title":"Chungar\u00e1 >> (Arica)","subject":["ARQUEOLOGIA"],"publisher":{"_":"Universidad de >> Tarapac\u00e1
Facultad de Ciencias Sociales Administrativas y >> Econ\u00f3micas
"},"insert_date":"20020415"}}, >> >> >> (VIEW B) >> >> {"id":"e5b72d48-5d18-43a8-aef9-27bd46f93fba","key":["scl","Agricultural >> Sciences","Scientia >> >> Agricola"],"value":{"collection":"scl","issn":"0103-9016","title":"Scientia >> Agricola","subject":["AGRONOMIA"],"publisher":{"_":"S\u00e3o Paulo - >> Escola Superior de Agricultura \"Luiz de >> Queiroz\""},"insert_date":"19981016"}}, >> {"id":"317c2636-7e56-422e-9720-f351568acc7f","key":["scl","Agricultural >> Sciences","scl","Summa >> >> Phytopathologica"],"value":{"collection":"scl","issn":"0100-5405","title":"Summa >> Phytopathologica","subject":["AGRONOMIA; FITOPATOLOGIA; >> FITOSSANIDADE"],"publisher":{"_":"Grupo Paulista de >> Fitopatologia"},"insert_date":"20061011"}}, >> {"id":"ea6d6684-a638-4ea6-8035-982ed8dd7326","key":["scl","Agricultural >> Sciences","scl","Tropical Plant >> >> Pathology"],"value":{"collection":"scl","issn":"1982-5676","title":"Tropical >> Plant Pathology","subject":["FITOPATOLOGIA"],"publisher":{"_":"Sociedade >> Brasileira de Fitopatologia"},"insert_date":"20080422"}}, >> {"id":"baadd506-9a83-4645-9dba-3c766a7a51b8","key":["ven","Agricultural >> >> Sciences","Agroalimentaria"],"value":{"collection":"ven","issn":"1316-0354","title":"Agroalimentaria","subject":["CIENCIAS >> ECON\u00d3MICAS Y SOCIALES, SOCIOLOG\u00cdA, AGRICULTURA, >> NUTRICI\u00d3N, ECONOM\u00cdA AGROALIMENTARIA, CONSUSMO DE ALIMENTOS, >> SEGURIDAD ALIMENTARIA, SISTEMA ALIMENTARIO, >> ALIMENTACI\u00d3N"],"publisher":{"_":"Centro de Investiagciones >> Agroalimentarias (CIAAL), Facultad de Ciencias Econ\u00f3micas y >> Sociales, Universidad de los Andes"},"insert_date":"20030407"}}, >> {"id":"02c01a5c-8986-4533-b390-f8a874ba2e8d","key":["ven","Agricultural >> >> Sciences","Bioagro"],"value":{"collection":"ven","issn":"1316-3361","title":"Bioagro","subject":["AGRONOM\u00cdA, >> BOT\u00c1NICA, ZOOLOG\u00cdA"],"publisher":{"_":"Decanato de >> Agronom\u00eda de la Universidad Centroccidental \"Lisandro Alvarado\" >> (UCLA)"},"insert_date":"20050310"}}, >> {"id":"edcf204d-b219-43ba-b565-d6c55f940e40","key":["ven","Agricultural >> Sciences","Revista de la Facultad de >> >> Agronom\u00eda"],"value":{"collection":"ven","issn":"0378-7818","title":"Revista >> de la Facultad de Agronom\u00eda","subject":["AGRICULTURA Y >> GANADER\u00cdA TROPICAL"],"publisher":{"_":"Facultad de >> Agronom\u00eda. Universidad del Zulia "},"insert_date":"20030715"}}, >> {"id":"b9963ad8-7454-4085-a980-375ccacb9fef","key":["ven","Agricultural >> Sciences","Zootecnia >> >> Tropical"],"value":{"collection":"ven","issn":"0798-7269","title":"Zootecnia >> Tropical","subject":["GANADER\u00cdA"],"publisher":{"_":"Instituto >> Nacional de Investigaciones Agricolas INIA, Maracay, Venezuela. >> "},"insert_date":"20041115"}}, >> {"id":"c2c64c77-712e-4e4b-a24d-0c9e81790512","key":["cub","Agropecuarias >> Sciences","Cultivos >> >> Tropicales"],"value":{"collection":"cub","issn":"0258-5936","title":"Cultivos >> Tropicales","subject":["INVESTIGACIONES >> AGR\u00cdCOLAS"],"publisher":{"_":"Ediciones >> INCA"},"insert_date":"20090424"}}, >> {"id":"e20d515c-e912-42c1-979f-1b1058cc499e","key":["chl","Applied >> Social Sciences","ARQ >> (Santiago)"],"value":{"collection":"chl","issn":"0717-6996","title":"ARQ >> (Santiago)","subject":["ARQUITECTURA"],"publisher":{"_":"Ediciones >> ARQ"},"insert_date":"20011212"}}, >> {"id":"50930791-6632-4fe4-a750-53b6fb64709e","key":["chl","Applied >> Social Sciences","Bolet\u00edn del Museo Chileno de Arte >> >> Precolombino"],"value":{"collection":"chl","issn":"0718-6894","title":"Bolet\u00edn >> del Museo Chileno de Arte >> Precolombino","subject":["ANTROPOLOGIA"],"publisher":{"_":"Museo >> Chileno de Arte Precolombino"},"insert_date":"20081105"}}, >> {"id":"6ec2ffbd-6539-4b66-bbd1-cffae01829c7","key":["chl","Applied >> Social Sciences","Chungar\u00e1 >> >> (Arica)"],"value":{"collection":"chl","issn":"0717-7356","title":"Chungar\u00e1 >> (Arica)","subject":["ARQUEOLOGIA"],"publisher":{"_":"Universidad de >> Tarapac\u00e1
Facultad de Ciencias Sociales Administrativas y >> Econ\u00f3micas
"},"insert_date":"20020415"}}, >> >> >> *The questions:* >> >> The index files became to large when creating view that represents a huge >> among of data. >> Is it the way the things work in couchdb? We could/must have a lot of >> views >> that bring mostly the same data just changing the key parameters to >> perform >> different queries? >> >> Thanks a lot! >> *Fabio Batalha C. Santos* >> Colegiado SciELO >> www.scielo.org >> FAPESP - CNPq - BIREME - FapUNIFESP >> >> >> >> On Fri, Jan 21, 2011 at 3:19 PM, Paul Davis> >wrote: >> >> On Fri, Jan 21, 2011 at 12:12 PM, Fabio Batalha Cunha dos Santos >>> wrote: >>> >>>> Hello All, >>>> >>>> I'm doing a lot of tests with views with multiple keys. I'd like to know >>>> >>> if >>> >>>> is it possible to ignore the content of the first key when fetching a >>>> >>> view. >>> >>>> For example: >>>> >>>> I have this view: >>>> >>>> {"rows":[ >>>> {"key":["arg","h"],"value":10721}, >>>> {"key":["arg","i"],"value":855}, >>>> {"key":["arg","t"],"value":71}, >>>> {"key":["chl","h"],"value":28129}, >>>> {"key":["chl","i"],"value":2158}, >>>> {"key":["chl","t"],"value":92}, >>>> {"key":["col","h"],"value":13696}, >>>> {"key":["col","i"],"value":1156}, >>>> {"key":["col","t"],"value":96}, >>>> ]} >>>> >>>> I'd like to with the startkey + endkey parameter filter the result to: >>>> >>>> {"rows":[ >>>> {"key":["arg","i"],"value":855}, >>>> {"key":["chl","i"],"value":2158}, >>>> {"key":["col","i"],"value":1156}, >>>> ]} >>>> >>>> Is it possible? >>>> >>>> Nope. If you want to do that you'll need to create a second view with >>> a reordered key, or a key that doesn't include what you want to skip. >>> >>> Thanks in advance, >>>> >>>> *Fabio Batalha C. Santos* >>>> Colegiado SciELO >>>> www.scielo.org >>>> FAPESP - CNPq - BIREME - FapUNIFESP >>>> >>>> > --20cf3054a0c1301731049a60805d--