Commit a0effe51 authored by Bertrand  NÉRON's avatar Bertrand NÉRON

add a taxonomy_terms view to allow autocompletion to retrieve a term of the taxonomy

modify by_replicon_taxonomy to be query document by any terms of its taxonomy 
parent 36c2f438
function(doc) {
var taxo = doc.replicon.taxonomy;
for( var i=0; i<taxo.length; i++ ){
emit(taxo[i], doc._id);
}
taxonomy = doc.replicon.taxonomy;
for( var j=0; j< taxonomy.length ; j++ ){
emit(taxonomy[j], {
"id" : doc._id,
"code" : doc.code ,
"name" : doc.replicon.name ,
"T3SS_family" : doc.T3SS_family,
"taxid" : doc.replicon.taxid,
"strain" : doc.replicon.strain ,
"taxonomy" : doc.replicon.taxonomy.join( ", ") ,
"type" : doc.replicon.type
});
}
}
function(doc) {
taxonomy = doc.replicon.taxonomy;
for( var j=0; j< taxonomy.length ; j++ ){
var term= taxonomy[j];
for( var syllabe_l = 3 ; syllabe_l <= term.length ; syllabe_l++){
for(var i=0; i<= term.length-syllabe_l; i++){
var key = term.substring(i, i+syllabe_l);
key = key.toLowerCase();
emit( [key, term] , 1 );
}
}
}
}
function(keys, values, rereduce){
return sum(values);
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment