Skip to content

Commit

Permalink
Merge branch 'v3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry committed Jul 25, 2020
2 parents 6ccb747 + a782016 commit 23d5404
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements_web.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ biothings[web_extra]==0.8.1
elasticsearch==6.3.1
elasticsearch-dsl==6.3.1
#Optional
raven
raven
20 changes: 19 additions & 1 deletion src/config_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,25 @@
CACHE_FOLDER = None

# when publishing releases, specify the targetted (ie. required) standalone version
STANDALONE_VERSION = "standalone_v3"
STANDALONE_VERSION = {"branch": "standalone_v3"}

# Autohub configuration, either from a static definition...
STANDALONE_CONFIG = {
"_default": {
"es_host": "localhost:9200",
"index": "mygene_test",
"doc_type": "gene"
},
"mygene.info": {
"es_host": "prodserver:9200",
"index": "mygene_prod",
"doc_type": "gene"
},
}
# ... or using a dynamic indexer factory and ES host (index names are then
# taken from VERSION_URLS and all are managed on one given ES host)
#AUTOHUB_INDEXER_FACTORY = "biothings.hub.dataindex.indexer.DynamicIndexerFactory"
#AUTOHUB_ES_HOST = "localhost:9200"

# Autohub configuration, either from a static definition...
STANDALONE_CONFIG = {
Expand Down
2 changes: 1 addition & 1 deletion src/config_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
# Elasticsearch Query Pipeline
# *****************************************************************************
ES_QUERY_BUILDER = "web.pipeline.MygeneQueryBuilder"

ES_RESULT_TRANSFORM = "web.pipeline.MygeneTransform"
AVAILABLE_FIELDS_EXCLUDED = ['all', 'accession_agg', 'refseq_agg']

# *****************************************************************************
Expand Down
3 changes: 2 additions & 1 deletion src/web/pipeline/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from .build import MygeneQueryBuilder
from .build import MygeneQueryBuilder
from .transform import MygeneTransform
14 changes: 14 additions & 0 deletions src/web/pipeline/transform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from biothings.web.pipeline import ESResultTransform

class MygeneTransform(ESResultTransform):

@staticmethod
def option_sorted(path, obj):
"""
Sort a container in-place.
"""
if path == 'homologene.genes':
return # do not sort this field

# delegate to super class for normal cases
ESResultTransform.option_sorted(path, obj)

0 comments on commit 23d5404

Please sign in to comment.