rnewson commented on PR #4291:
URL: https://github.com/apache/couchdb/pull/4291#issuecomment-1341152139

   API choices.
   
   Currently you can define a nouveau index almost identically to clouseau, the 
`index()` function behaves the same way, you just need to use "nouveau" as a 
top-level key instead of "indexes";
   
   clouseau;
   
   ```
   {
     "indexes": {
       "bar": {
         "default_analyzer": "standard",
         "field_analyzers": {
           "foo": "english"
         },
         "index": "function(doc) { index(\"foo\", \"bar\", {\"store\":true}); 
index(\"bar\", doc.bar, {\"store\":true,\"facet\":true}); }"
       }
     }
   }
   ```
   
   nouveau
   ```
   {
     "nouveau": {
       "bar": {
         "default_analyzer": "standard",
         "field_analyzers": {
           "foo": "english"
         },
         "index": "function(doc) { index(\"foo\", \"bar\", {\"store\":true}); 
index(\"bar\", doc.bar, {\"store\":true,\"facet\":true}); }"
       }
     }
   }
   ```
   
   the index() function is enhanced for nouveau 
(https://github.com/rnewson/nouveau#index-function) giving the user better 
control over the indexing process but the basic shape for clouseau works the 
same.
   
   The alternative proposal is to use a version attribute
   
   ```
     "indexes": {
       "bar": {
         "version": 2,
         "default_analyzer": "standard",
         "field_analyzers": {
           "foo": "english"
         },
         "index": "function(doc) { index(\"foo\", \"bar\", {\"store\":true}); 
index(\"bar\", doc.bar, {\"store\":true,\"facet\":true}); }"
       }
     }
   }
   ```
   
   This could either be a `"version": 2` or perhaps a `"engine": "nouveau"`
   
   dreyfus and erlang-side nouveau would be adjusted to take the appropriate 
subset from the "indexes" object if we went this way.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to