Skip to content

Commit

Permalink
clean up of search scripts, mostly
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Mar 17, 2014
1 parent 0e08cb8 commit de67afe
Show file tree
Hide file tree
Showing 21 changed files with 69 additions and 48 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ michael-local
.Trashes
ehthumbs.db
Thumbs.db
scripts/search/data
3 changes: 2 additions & 1 deletion doc/Sphinx/source/Developers/dev4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ If you have an old copy of the database and want to start fresh, here are the re

- drop your old database
- create a new database
- run the reference data script: ``scripts/database/reference_data.sql`` (NOTE: run the script as user ``postgres``; i.e., do not attempt to run it as your application database user, for example, ``dvnApp``!)
- deploy the app
- run the reference data script: ``scripts/database/reference_data.sql`` (NOTE: run the script as user ``postgres``; i.e., do not attempt to run it as your application database user, for example, ``dvnApp``!)
- if you are not using ``dvnApp`` as the postgres role, run the following SQL line, substituting the name of the role you are using: ``ALTER TABLE filesystemname_seq OWNER TO "myRole";``
- ``cd scripts/api``
- ``./datasetfields.sh`` (*)
- ``./setup-users.sh``
Expand Down
5 changes: 5 additions & 0 deletions scripts/database/facetlist.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- default facets defined in https://redmine.hmdc.harvard.edu/issues/3490
-- show selected facets by displayorder
SELECT title,name,datasetfield.id FROM dataversefacet, datasetfield WHERE dataversefacet.datasetfield_id = datasetfield.id ORDER BY dataversefacet.displayorder;
-- more detail
-- SELECT dataversefacet.id, title, name, datasetfield.id, dataversefacet.displayorder, dataverse_id FROM dataversefacet, datasetfield WHERE dataversefacet.datasetfield_id = datasetfield.id ORDER BY displayorder;
14 changes: 0 additions & 14 deletions scripts/database/facetpopulate.sql

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/database/homebrew/non-dvnApp-role

This file was deleted.

2 changes: 0 additions & 2 deletions scripts/database/homebrew/run-astrodatablock.sql

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/database/homebrew/run-facet-script

This file was deleted.

2 changes: 2 additions & 0 deletions scripts/database/homebrew/run-non-dvnApp-role
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
~/.homebrew/bin/psql dataverseDb -c 'ALTER TABLE filesystemname_seq OWNER TO "dataverseApp";'
2 changes: 0 additions & 2 deletions scripts/database/homebrew/run-root_dataverse_setup.sql

This file was deleted.

2 changes: 0 additions & 2 deletions scripts/database/homebrew/run-sql-script

This file was deleted.

12 changes: 0 additions & 12 deletions scripts/database/homebrew/setup

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/database/homebrew/watermark

This file was deleted.

6 changes: 3 additions & 3 deletions scripts/search/create
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DVDIR_TREES='data/in/dataverses.trees'
DSDIR='data/in/datasets'
FILESDIR='data/in/files'

rm data/in/dataverses/1
#rm data/in/dataverses/1
for i in `ls $DVDIR_ROOT`; do
curl -H "Content-type:application/json" -X POST -d @$DVDIR_ROOT/$i "http://localhost:8080/api/dvs/root?key=pete"
done
Expand All @@ -19,8 +19,8 @@ for i in `ls $DVDIR_TREES`; do
done

# 9 is "sparrows"
curl -H "Content-type:application/json" -X POST -d @data/in/dataverses.misc/8 "http://localhost:8080/api/dvs/9?key=pete"
curl -H "Content-type:application/json" -X POST -d @data/in/dataverses.misc/9 "http://localhost:8080/api/dvs/trees?key=pete"
#curl -H "Content-type:application/json" -X POST -d @data/in/dataverses.misc/8 "http://localhost:8080/api/dvs/9?key=pete"
#curl -H "Content-type:application/json" -X POST -d @data/in/dataverses.misc/9 "http://localhost:8080/api/dvs/trees?key=pete"

#for i in `ls $DSDIR`; do
# curl http://localhost:8080/api/datasets -H 'Content-type:application/json' --data-binary @$DSDIR/$i
Expand Down
8 changes: 8 additions & 0 deletions scripts/search/data/in/dataverses.birds/4
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"affiliation": "Birds Inc.",
"alias": "finches",
"contactEmail": "[email protected]",
"description": "A dataverse with finches",
"name": "Finches",
"permissionRoot": "false"
}
8 changes: 8 additions & 0 deletions scripts/search/data/in/dataverses.birds/5
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"affiliation": "Birds Inc.",
"alias": "sparrows",
"contactEmail": "[email protected]",
"description": "A dataverse featuring sparrows",
"name": "Sparrows",
"permissionRoot": "false"
}
8 changes: 8 additions & 0 deletions scripts/search/data/in/dataverses.birds/6
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"affiliation": "Birds Inc.",
"alias": "wrens",
"contactEmail": "[email protected]",
"description": "A dataverse full of wrens",
"name": "Wrens",
"permissionRoot": "false"
}
8 changes: 8 additions & 0 deletions scripts/search/data/in/dataverses.root/2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"affiliation": "Birds Inc.",
"alias": "birds",
"contactEmail": "[email protected]",
"description": "A bird dataverse with some trees",
"name": "Birds",
"permissionRoot": "false"
}
8 changes: 8 additions & 0 deletions scripts/search/data/in/dataverses.root/3
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"affiliation": "Trees Inc.",
"alias": "trees",
"contactEmail": "[email protected]",
"description": "A tree dataverse with some birds",
"name": "Trees",
"permissionRoot": "false"
}
8 changes: 8 additions & 0 deletions scripts/search/data/in/dataverses.trees/7
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"affiliation": "Trees Inc.",
"alias": "spruce",
"contactEmail": "[email protected]",
"description": "A spruce with some birds",
"name": "Spruce",
"permissionRoot": "false"
}
8 changes: 8 additions & 0 deletions scripts/search/data/in/dataverses.trees/9
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"affiliation": "Trees Inc.",
"alias": "chestnuttrees",
"contactEmail": "[email protected]",
"description": "A dataverse with chestnut trees and an oriole",
"name": "Chestnut Trees",
"permissionRoot": "false"
}
2 changes: 1 addition & 1 deletion scripts/search/populate
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ mkdir -p $DSDIR
mkdir -p $FILESDIR
count=1; ./tab2json dv.tsv | while read i; do echo $i | python -m json.tool > $DVDIR/$count; let count++; done
count=1; ./tab2json ds.tsv | while read i; do echo $i | python -m json.tool > $DSDIR/$count; let count++; done
count=1; ./tab2json files.tsv | while read i; do echo $i | python -m json.tool > $FILESDIR/$count; let count++; done
#count=1; ./tab2json files.tsv | while read i; do echo $i | python -m json.tool > $FILESDIR/$count; let count++; done

0 comments on commit de67afe

Please sign in to comment.