Re: Best way to model historical data

2011-11-07 Thread Patrick Barnes
Hi Andres, For your historical data; do you need to run all the same levels of queries on it? Or would you be more likely to only need the historical data so that you can undo changes? For the latter case, consider if storing a copy of the previous versions of a document as a json attachment

Re: Empty response for PUT in CouchDB 1.1.0

2011-09-18 Thread Patrick Barnes
There is additionally several PHP couch libraries. I use and would recommend you try https://github.com/dready92/PHP-on-Couch/ There's no sense in reinventing the wheel again and again... On 18/09/2011 5:29 PM, Jens Alfke wrote: Looks like you're rolling your own HTTP library, which is a bit wo

Re: Iterating all documents

2011-07-06 Thread Patrick Barnes
Alternatively, how about you page through _all_docs? 1. Query http://server:5984/dbname/_all_docs?limit=100 2. Process that set. Store the id of the last document. 3. Query http://server:5984/dbname/_all_docs?limit=100&startkey=(last_id)&skip=1 to get the next set. 4. Repeat 2 and 3 until t

Re: few doubts

2011-07-05 Thread Patrick Barnes
Node without installing lampp? I guess I could just steal the logic. On Tue, Jul 5, 2011 at 5:00 PM, Patrick Barnes wrote: I have written a PHP script for my application to do this seamless update: https://gist.github.com/1066246 I find it very useful! My rebuild time is about 30 minutes, so if

Re: json date representations

2011-07-05 Thread Patrick Barnes
I use ISO8601 as well; "2010-08-29T13:07:49+10:00" (generated using PHP date('c');) On 6/07/2011 9:49 AM, Rudi Benkovič wrote: Hi, I'm writing a little CouchDB administration utility and would like to find out how most of you store data values in JSON. From .NET via Newtonsoft's JSON serializer

Re: few doubts

2011-07-05 Thread Patrick Barnes
I have written a PHP script for my application to do this seamless update: https://gist.github.com/1066246 I find it very useful! My rebuild time is about 30 minutes, so if it blocked I'd have users screaming at me in short order. One or two aspects of the script are app-specific, but it should

Re: few doubts

2011-07-03 Thread Patrick Barnes
On 4/07/2011 1:11 PM, Matthew John wrote: Hi all, I am a newbie at CouchDB. I had a few queries back in my mind and thought I would shoot them here: 1) I am familiar with MySql systems. In one of the applications I ve made, whenever the server gets restarted I used to perform a warm up (similar

Re: Reduces out of order?

2011-06-19 Thread Patrick Barnes
It might be possible to work around this, depending on how typically out-of-order the documents are; Have the reduce object be initially: { result: "", version: 0, unapplied_deltas: [] //(a sorted list) } where each element of unapplied_deltas is: { from:M, to:N, delta:"..." }

Re: Backup, Point In Time recovery

2011-06-17 Thread Patrick Barnes
I would *really* like to have functionality like this... Perhaps a mechanism to manage serial snapshots of the db's state? It seems to me be that maybe a snapshot could just be a header that does not get compacted away, and that one could: - 'Roll-back' the database to a given snapshot. (Undo,

Re: All tests fail

2011-06-13 Thread Patrick Barnes
This apparently occurs because if you upgrade over an existing installation, some older .beam files remain and cause conflicts. Move the (install path)/lib/couchdb folder somewhere else, run 'make install' again, and see if the tests work. Worked for me, -Patrick On 13/06/2011 11:03 PM, Dani

Re: JSON Patch Internet Draft 01

2011-06-09 Thread Patrick Barnes
On path components, I wonder why an inline delimiter was chosen? Would it be sensible to use an array instead? Document: { "a": { "a1":"foo", "a2":"foo2" }, "b": "notappearinginthisfilm" "c": [0,1,2,4,5] } Patch: [ { "replace": ["a","a2"], "value":"bar2" }, { "remove": ["b"]

Re: Breaking changes 1.1.0

2011-06-08 Thread Patrick Barnes
over the top of an existing CouchDB > installation? If so, you have mingled two conflicting versions of our > modules together, which is going to cause function_clause errors all > over the place. > > B. > > On 8 June 2011 03:46, Patrick Barnes wrote: >> Having just updated

Breaking changes 1.1.0

2011-06-07 Thread Patrick Barnes
Having just updated to 1.1.0, I think I've been caught by the one breaking change listed; * Document id's are now validated during PUT. This means that some PUT requests will fail that previously succeeded. The user object I'm trying to store is: |{ ||"|_id|": |"org.couchdb.user:test_appdata_

Re: error during map function

2011-05-31 Thread Patrick Barnes
Try typing 'js' from the server shell - it'll have been installed with couchdb, if it wasn't there already. It gives you an interactive js interpreter. Then, you can paste in your function; var map = function (doc) { } and it may tell you where the syntax error lies. Alternatively if you

Re: Mapping multiple entries in an array field? (like tags)

2011-05-23 Thread Patrick Barnes
On 23/05/2011 6:08 PM, He Shiming wrote: @Patrick. The number of combination isn't that scary, given tags are sorted. For a 2-tag query, 2-tag documents will have 1 combination only, and 3 for 3-tag docs. 45 combinations for 10-tag docs. How do you get 45? '10 choose 3' is 120. Also, you don'

Re: Mapping multiple entries in an array field? (like tags)

2011-05-22 Thread Patrick Barnes
With your original idea; to emit for each combination of tags... you may still end up with an unworkable number of records in your view. Say for each document you emit combinations of tags, in alphabetical order. Limiting the maximum number of matched tags to 3, for example, will help limit th

Re: Mapping multiple entries in an array field? (like tags)

2011-05-22 Thread Patrick Barnes
calhost:5984/db/ \ -H "Content-Type: application/json" -d '{"keys":["couchdb","python"]}' Hope that helps, -Patrick Barnes On 22/05/2011 4:59 PM, He Shiming wrote: Dear Community, I'm working with documents like this: { "tags": [&

Re: Dealing with sealed docs

2011-04-20 Thread Patrick Barnes
g those, only adding two extra attributes to the new object created. (Not having to _copy_ every element should also make this approach much faster than using a generic 'clone' method) Hope that works. :-) -Patrick On 21/04/2011 1:00 AM, Hay (Husky) wrote: On Wed, Apr 20, 2011 at 4:

Re: Dealing with sealed docs

2011-04-20 Thread Patrick Barnes
Actually, he is... if doc.events is an object, then the object might not actually be copied, but only a reference. If you change var events = doc.events; to var events = clone doc.event; Does that fix it? On 20/04/2011 10:59 PM, Jan Lehnardt wrote: On 20 Apr 2011, at 14:11, Nils Breunese w

Re: Recommendations for how to do faceted search in CouchDB

2011-03-31 Thread Patrick Barnes
For searching for an arbitrary set of conditions on fields, you will want to use a search component like couchdb-lucene. It's not just useful for full-text search; if you have a bunch of parameters that you want to filter on, your lucene view can look like: function(doc) { var ret = n

Re: Recommendations for how to do faceted search in CouchDB

2011-03-29 Thread Patrick Barnes
anks andrew On 30/03/2011, at 2:13 PM, Patrick Barnes wrote: You can do that with a single view: In the map, emit for each field key [fieldname,fieldvalue] and value null. In the reduce, set it to '_count' (instead of a js function) to use the fast built-in reduce. Then you can query

Re: Recommendations for how to do faceted search in CouchDB

2011-03-29 Thread Patrick Barnes
You can do that with a single view: In the map, emit for each field key [fieldname,fieldvalue] and value null. In the reduce, set it to '_count' (instead of a js function) to use the fast built-in reduce. Then you can query that view with startkey=[fieldname]&endkey=[fieldname,{}]&group=true

Re: Question about validator functions and replication

2011-03-29 Thread Patrick Barnes
le. * To get the keys to the user's client, you could store them in encrypted form within the user document, with the password as key. (That way if the password changes, you only have to re-encrypt one document.) -Patrick B. On 29 March 2011 00:41, Patrick Barnes wrote: On 29/03/2011 2:

Re: Question about validator functions and replication

2011-03-28 Thread Patrick Barnes
On 29/03/2011 2:38 AM, Nebu Pookins wrote: If you have some secure data floating around in your db, encryption can > still be a good idea. Parts of one of my databases are encrypted, because > users need to be able to see some documents in the db but not others. I'm curious as how you've imple

Re: Question about validator functions and replication

2011-03-26 Thread Patrick Barnes
asant again. I'll probably end up going with solution (2) because the proposed app we're building will have to deal with banking and financial data, so we're going to have to have some cryptography in there anyway, but I'm just making sure I'm not missing anything (such as C

Re: Question about validator functions and replication

2011-03-24 Thread Patrick Barnes
You're quite right, it would fail on replication. (And if you identified that issue solely from a hypothetical standpoint, well done) The solution could be to give your replication user as 'replication' role, and have the validator function look something like: function(newDoc, oldDoc, userCt

Re: PHP-based SHA1 algorithm?

2011-03-23 Thread Patrick Barnes
Hi Martin, There is an example in php here: https://github.com/dready92/PHP-on-Couch/blob/master/lib/couchAdmin.php#L163 On 23/03/2011 2:33 PM, Martin Hewitt wrote: Hi all, I'm writing a build process in Phing, part of which involves creating a new CouchDB user. I'm having trouble logging in

Re: validate_doc_update responsibilities

2011-03-10 Thread Patrick Barnes
I suggest using couchapp to store your field meta-info (validation, format, etc) in a config/ folder or file, then you can: a) Include it into your validate_doc_update.js file like: function (newDoc, oldDoc, userCtx) { // !json config.form b) Refer to it from elsewhere like: (PHP, because that

Re: how to ignore conflicts?

2011-03-03 Thread Patrick Barnes
Perhaps you need a process to resolve conflicts? On 4/03/2011 12:19 PM, Mark Hahn wrote: I have a situation where I only want to know the latest version of a doc and I don't care about any older versions. I don't care about conflicts. As far as I can tell there is no way to ignore conflicts in

Odd replication failures on 0.11

2011-02-07 Thread Patrick Barnes
I have been getting this error when I try to replicate databases: Replication failed: {bad_term,{couch_rep_reader,'-open_doc_revs/3-fun-1-', [{[{<<"error">>,<<"unauthorized">>}, {<<"reason">>, <<"You are no

Re: CouchDB key that always matches

2011-01-16 Thread Patrick Barnes
Tristan, if you are looking to run more complex queries (particularly anything to do with wildcards) you should really look at couchdb-lucene. http://github.com/rnewson/couchdb-lucene -Patrick On 17/01/2011 1:01 PM, Tristan Sloughter wrote: I'm looking to query my Couch database in such a way

Re: Creating databases on demand

2010-11-22 Thread Patrick Barnes
Hi Jeff, On 23/11/2010 5:10 PM, Jeff Gorder wrote: I have a case where there is a main public database that serves my application and then will need to have a private database for each user. I've gotten this to work manually and automatically when logged in as a server admin. I understand tha

Re: Volume Test - 2 million documents

2010-10-12 Thread Patrick Barnes
13/10/2010 1:32 PM, Paul Davis wrote: On Tue, Oct 12, 2010 at 10:25 PM, Patrick Barnes wrote: While you're refactoring, can I suggest - for each view, store a checksum of the map/reduce functions? At the moment, If something unrelated (like the validation function, or a version number) in

Re: Volume Test - 2 million documents

2010-10-12 Thread Patrick Barnes
While you're refactoring, can I suggest - for each view, store a checksum of the map/reduce functions? At the moment, If something unrelated (like the validation function, or a version number) in the design document is changed, it's rebuilding all the views and it doesn't need to. -Patrick

Re: design doc weakness (one view fails = all views fail)

2010-10-10 Thread Patrick Barnes
Yes it does, all views of a design doc update at once. If you have some views that are not often needed, but are very expensive to generate, it can be better to put them in another design doc. On 10/10/2010 11:08 PM, mickael.bai...@free.fr wrote: That's interesting. For my personnal curiosity:

Re: Replication Question

2010-10-03 Thread Patrick Barnes
Not exactly, as I understand it. I believe that couchdb guarantees that after bi-directional replication, for any conflicted documents all dbs will choose the same rev as the 'successful' one, with the other revs in the _conflicted area. I too, would love to have a means of automatically resol

Re: Couchdb-lucene and readers problem

2010-09-26 Thread Patrick Barnes
assuming you've set require_valid_user=true? If so, you need to add a user:pass value to couchdb-lucene's ini file. The details are in the README under "Security". Sent from my iPad On 24 Sep 2010, at 07:53, Patrick Barnes wrote: I have couchdb-lucene set up and working fine - I can

Couchdb-lucene and readers problem

2010-09-23 Thread Patrick Barnes
I have couchdb-lucene set up and working fine - I can query the fulltext view I have defined. (Using couchdb-lucene 0.5.6 and couchdb 1.0.1) However, if I set any readers in the database's security options and call with *proper* credentials, couchdb-lucene fails, with response: {"code":500, "

Re: req argument in view

2010-09-17 Thread Patrick Barnes
Can you be more specific? What do you mean by a 'req argument'? From a view you can fetch all values with a single key, a number of keys, or a contiguous range of keys specified by startkey/endkey. On 18/09/2010 3:41 PM, Tyler Gillies wrote: On Fri, Sep 17, 2010 at 10:32 PM, Tyler Gillies w

Re: Conditional joins

2010-09-17 Thread Patrick Barnes
The basic tenets of views are: 1. Map/reduce functions must be idempotent, and look only at the document/data passed to it. 2. Emitted keys get sorted onto a single axis, and with view queries you can retrieve a single given key, multiple given keys, or a contiguous subset of keys with a given

Re: Seamless view rebuilding?

2010-08-26 Thread Patrick Barnes
building feature. :) B. On Thu, Aug 26, 2010 at 2:40 PM, Patrick Barnes wrote: I have a database serving documents through a number of intermediary application servers, to the users' web browsers. There are two mechanisms by which documents are modified; a) Piecemeal updates as a result of use

Seamless view rebuilding?

2010-08-26 Thread Patrick Barnes
Stale=ok is a simple solution to the bulk problem, but the application servers will also expect to be able to update documents, and retrieve the changes immediately after. Is there a good way to avoid these large view update delays? -Patrick Barnes

Re: Content type response

2010-07-06 Thread Patrick Barnes
PM, Nils Breunese wrote: Patrick Barnes wrote: For what its worth, I have found JSONView to be a useful Firefox extension - it adds accepts:application/json to the request headers, and any json content is properly formatted and displayed in the window. It's nice when working with CouchDB

Re: Content type response

2010-07-03 Thread Patrick Barnes
For what its worth, I have found JSONView to be a useful Firefox extension - it adds accepts:application/json to the request headers, and any json content is properly formatted and displayed in the window. -Patrick On 04/07/2010 2:03 AM, "J Chris Anderson" wrote: On Jul 3, 2010, at 7:45 AM, Pa

Couchdb and OpenSolaris

2010-07-02 Thread Patrick Barnes
..(goes on for a long time, includes the _user db validate_doc_update function text) - Most of the tests don't work, including the 'basics' test - the status changes to 'running', but the test never completes. Happy to help with chasing these things up, but not sure where to start. -Patrick Barnes

Re: View Efficency

2010-06-29 Thread Patrick Barnes
As Daniel Truemper said, couchdb-lucene is what you want for any kind of partial matching capability. A couchdb-lucene query can also be crafted to match A OR B. If you only want a straight OR match, for instance "show me documents where doc.author is '0102010' or '0102014'", then the simplest

Re: Can I get just the keys from a view? [SEC=UNCLASSIFIED]

2010-06-14 Thread Patrick Barnes
On 15/06/2010 2:33 PM, Lowry, Matthew wrote: Reading between the lines, I get the impression that the answer to my question is "No - the view API does not support fetching keys without values." This is a pity. And strangely inconsistent with the document API, in my opinion. The document API allow

Re: Can I get just the keys from a view? [SEC=UNCLASSIFIED]

2010-06-14 Thread Patrick Barnes
The document API is a view as well, where the value emitted for each doc is null. You say that each of the rows in your view has a large value object, but that you don't need it? Then why are you emitting it in the first place? If you have two different use cases; a) Fetching lots of keys b)

Re: CouchDB in multi-tenant environment

2010-06-09 Thread Patrick Barnes
Another solution is to use couchapp - 'couchapp push' on an existing database will only update the design doc. As part of the upgrade process, you can just run push for each database. This would be simple in an upgrade script - it could even load the list of databases out of couchdb first. -Patri

Re: Help a noob upgrade couchDB from 0.8 to 0.11

2010-05-30 Thread Patrick Barnes
Steven: Also, from source, couchdb will install by default to /usr/local/couchdb. If you wish to override the 0.8.0 version and install it at top-level, you may need to re-run the source installation steps, using: ./configure --prefix=/ --exec-prefix=/ Remember of course to restart couchdb.

Re: Literature Survey

2010-05-29 Thread Patrick Barnes
n't need their own db. There's no "literature" for it yet, or even much documentation - but I'd be happy to discuss it with you further if you're interested. I'd love to know more about what you're planning, as well. Patrick Barnes Senior Software Engi

Re: Delete document Tree Structure

2010-05-26 Thread Patrick Barnes
How do you currently organise the documents into a tree and display them? For my trees, I have a 'hierarchy' array attribute that basically holds a tree address, eg: A = {"_id":"A", "hierarchy":["A"]}; B = {"_id":"B", "hierarchy":["B"]}; C = {"_id":"C", "hierarchy":["B","C"]}; D

Testing suite and upgrades

2010-05-20 Thread Patrick Barnes
I recently upgraded my couchdb server, and I can't run the test suite; there are existing databases and users defined. Is there a better way to test that the database server is working properly other than having to delete all the administrators and manually restore them later? -Patrick

Re: Couchdb and PHPUnit

2010-04-19 Thread Patrick Barnes
That does seem to be the way to go about implementing such a system. I will see how I go, and will publish the results if I end up with something that seems reusable. -Patrick On 19/04/2010 6:00 PM, Thomas Nunninger wrote: Hi, Am Montag, 19. April 2010 09:44:22 schrieb Patrick Barnes

Re: Couchdb and PHPUnit

2010-04-19 Thread Patrick Barnes
Partly - I was wondering also if there was something similar to the functionality phpunit has for initialising database contents from XML files, etc. On 19/04/2010 5:15 PM, David Coallier wrote: On 19 April 2010 07:16, Patrick Barnes wrote: Has anyone on the list (or elsewhere) written code

Couchdb and PHPUnit

2010-04-18 Thread Patrick Barnes
Has anyone on the list (or elsewhere) written code for phpunit to make setting up /tearing down couchdb test databases for unit testing easier? Cheers, -Patrick

Re: Adding a member into a JSON object in map function

2010-04-12 Thread Patrick Barnes
Try running 'js' from the console - it's an interactive javascript interpreter that makes figuring these things out much easier. Try: function(doc) { doc.hash = md5(doc.passwd); emit(null, doc); } On 13/04/2010 3:42 PM, Cesar Delgado wrote: I'm playing around with CouchDB and a

Re: Validate uniqueness field

2010-03-29 Thread Patrick Barnes
To nitpick slightly - you won't get a value of zero, you'll just find that there is no entry for the given key. ;-) -Patrick On 30/03/2010 3:06 AM, "Daniel Itaboraí" wrote: Distributed uniqueness is a hard problem, but since you intend to use it only on a single node, perhaps you should create

Re: Deciding on the structure of documents

2010-03-28 Thread Patrick Barnes
#x27;m not sure if that would cause further issues regarding whether to invalidate content changes made by X, or how best to resolve that sort of thing. On 29/03/2010 12:58 PM, Robert Sanford wrote: On Sun, Mar 28, 2010 at 7:20 PM, Patrick Barnes wrote: For the single-document situation: W

Re: Deciding on the structure of documents

2010-03-28 Thread Patrick Barnes
Hi Ben, I don't have all the answers for you, but a few tips... On posts and comments - It is important to think in terms of concurrency - a person will write and submit a post once, and people will reply in comments many times. For the single-document situation: What if multiple people reply

Re: Sorting padded numbers?

2010-03-17 Thread Patrick Barnes
Luis - if you emit them as numbers rather than strings, they will sort in the proper order. >From memory, I think one of the string methods is used to convert string to int. Alternatively, consider storing those properties as numbers in the first place - not only will your keys sort properly, but

Re: Key sorting by integer

2010-03-11 Thread Patrick Barnes
Is there any reason you are storing your numeric values as strings in the first place? (In JSON notation 11234 and "11234" are a number and a string, respectively) If you were emitting numbers for that part of the key array, then it would sort the way that you're after. On 12/03/2010 11:16 A

Re: Newbie problem with template path

2010-02-27 Thread Patrick Barnes
To confirm... You *are* using couchapp to generate your design doc, keeping the view and show funcs in files, and the included files in the same couchapp area? -Patrick On 28/02/2010 6:57 AM, "Clemens Cap" wrote: I am having a problem to understand the path where the engine looks for the files

Re: Selecting part of a multi-value key

2010-02-21 Thread Patrick Barnes
Hi Barry, There are three ways to select data out of a view... A specific key: ?key=["foo"] A number of specific keys: keys=[["foo"], ["bar"], ["baz"]] (Which is passed in as user data on a POST request. A contiguous region of keys, delimited by startkey and endkey. If you have a view where

Suspected view generator bug...

2010-02-18 Thread Patrick Barnes
#x27;ve rewritten my map functions to clone the array to a local var before I call path.pop(). -Patrick Barnes

Couchdb and futon authentication on trunk (910404)

2010-02-15 Thread Patrick Barnes
before), so it might just be my server, but this behaviour seems either odd or incomplete. Thoughts? (Also, can 'sign up' be disabled / admin users allowed to create new users?) -Patrick Barnes

Re: couchdb-lucene fulltextsearch

2010-02-13 Thread Patrick Barnes
Read through the documentation at http://github.com/rnewson/couchdb-lucene (Keep scrolling further down the page) When you call rec.add() (And you can call add() more than once per function), there is an optional second argument to set the indexing options: The two that you'd probably find use

Re: parametrized view generation

2010-02-09 Thread Patrick Barnes
Hi madhav, Typically, you create a view where the key is the data you want to filter on, and the value is the data you want to retrieve. eg: If you have a big db of people, and you want to be able to look up people by their phone number, and will want to display at least their names: map =

Re: solving a particular query

2010-02-02 Thread Patrick Barnes
Couchdb does not do fulltext searching itself. (eg for a website's search function) For search, the generally accepted 'best' solution is couchdb-lucene - it plugs into couchdb to give you all those nifty matching features. -Patrick On 02/02/2010 9:25 PM, "Jo Giraerts" wrote: Hi, I'm just sta

Re: Futon alternatives for editing design docs?

2010-02-01 Thread Patrick Barnes
Have you looked at / tried couchapp? I'm using it for my development - it allows me to use proper version control on what goes into the design docs. -Patrick On 02/02/2010 10:22 AM, "Phil Rand" wrote: Hi all, I've been playing around with couchdb for a while, but am getting frustrated with Fut

Re: Trees and leaf nodes

2010-02-01 Thread Patrick Barnes
n if feasible, that would only work using one key at a time. *yawns* But the grouped query makes sense, I'll test it tomorrow. -P On 1/02/2010 10:04 PM, Brian Candler wrote: On Mon, Feb 01, 2010 at 05:43:29PM +1100, Patrick Barnes wrote: It looks messy if the node has a little 'expand&

Trees and leaf nodes

2010-01-31 Thread Patrick Barnes
} } So things mostly work nicely - I can click on a node, and it will dynamically load children, rinse, repeat. It looks messy if the node has a little 'expand' icon next to it, though - but there are no actual children below it. Is it possible to create a view that will emit as value whether each node has children? Cheers, -Patrick Barnes

Re: CouchDB-Lucene, getting it running

2010-01-19 Thread Patrick Barnes
I have run into similar problems.before... in your logs I can see a bunch of references to 'gcj'. I suggest you install the Sun Java JDK and make sure maven is using it...That should hopefully fix your issue. The incompatibility doesn't appear to be in couchdb-lucene, but in the maven testing fra

Re: sorting documents using multiple keys

2009-12-24 Thread Patrick Barnes
Perhaps if you have a document set small enough to retrieve by explicit keys, you can just sort by date on the client? -Patrick On 24/12/2009 9:17 PM, "Borja Martín" wrote: Hi, thanks for your answer. The thing is that this solution only works for single keys and I can't use the startkey/endkey

Re: Couchdb-lucene and pre-generating indexes?

2009-12-22 Thread Patrick Barnes
ry (any query) just like the same rule for trigger view building. I should note that both versions take ?stale=ok will not block for updates, returning search results based on what's currently indexed. On Tue, Dec 22, 2009 at 6:52 AM, Patrick Barnes wrote: > Hi, > > I want to use ...

Couchdb-lucene and pre-generating indexes?

2009-12-21 Thread Patrick Barnes
Hi, I want to use couchdb-lucene to search approx 350k records - is there a way to have it build the indexes before starting a search? I don't seem to be able to get results. So far, I've gotten: * couchdb-lucene built and installed * bin/run running (as root for now) * couchdb configured to

Re: transform functions?

2009-12-11 Thread Patrick Barnes
http://wiki.apache.org/couchdb/How_to_intercept_document_updates_and_perform_additional_server-side_processing It's a fairly new feature, and isn't covered properly by the book yet. Don't worry, I saw a post claiming that validate_doc_update could modify the newDoc var (it can't), and wrote a fa

Re: _show without docid returns 500 instead of 404

2009-12-01 Thread Patrick Barnes
n Tue, 2009-12-01 at 22:39 +1100, Patrick Barnes wrote: Hi Markus, When you get a 500 error, it is typically because one of your javascript functions has had a run-time error. In your error log, see: "JavaScript function raised error: TypeError: doc is null" You can't assume

Re: _show without docid returns 500 instead of 404

2009-12-01 Thread Patrick Barnes
Hi Markus, When you get a 500 error, it is typically because one of your javascript functions has had a run-time error. In your error log, see: "JavaScript function raised error: TypeError: doc is null" You can't assume that doc is always a document - As the book states in a following para

Re: Managing synchronisation with an external data source

2009-11-25 Thread Patrick Barnes
Thanks, will implement something like that. -Patrick On 25/11/2009 7:46 PM, "Brian Candler" wrote: On Mon, Nov 23, 2009 at 01:10:26PM +1100, Patrick Barnes wrote: > The external data is delivered as ... Sounds like you need a merge. Taking users as an example: - have a couch

Re: Comment tree design in CouchDB?

2009-11-24 Thread Patrick Barnes
lve this? Perhaps I really think way to complex, or there's something wrong with the view logic I am thinking of. Greetings, Lennart On Nov 18, 2009, at 12:23 PM, Patrick Barnes wrote: I would suggest that each comment has a 'hierarchy' attribute, like an OID... For instance: (&#

Managing synchronisation with an external data source

2009-11-22 Thread Patrick Barnes
and roles. (Whether roles should be stored in the user document or separately, I'm not yet sure) Given that there are ~200k users, ~150k roles, and ~3k groups, how would you suggest this update process be approached? Regards, -Patrick Barnes

Foreign key checking?

2009-11-18 Thread Patrick Barnes
e_doc_update to check that the user and group the role refers to exist? I don't want orphan roles to be able to be created. (Alternatively: Is there a better way to do this?) -Patrick Barnes

Re: Comment tree design in CouchDB?

2009-11-18 Thread Patrick Barnes
I would suggest that each comment has a 'hierarchy' attribute, like an OID... For instance: ('.'s for padding) [ {"hierarchy":[1], "id":1, "data":"foo"} ...{"hierarchy":[1,2], "id":2, "data":"foo"} ...{"hierarchy":[1,3], "id":3, "data":"foo"} ..{"hierarchy":[1,3,5], "id":5, "data":"foo"}