-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #499 from monarch-initiative/additional-solr-assoc…
…iation-fields
- Loading branch information
Showing
5 changed files
with
84 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/sh | ||
|
||
# Add two dynamicfields declarations to the schema | ||
|
||
# One for text fields, have to replace because _t comes built in | ||
|
||
# delete the _t dynamic field | ||
curl -X POST -H 'Content-type:application/json' --data-binary '{ | ||
"delete-dynamic-field": { | ||
"name": "*_t" | ||
} | ||
}' http://localhost:8983/solr/association/schema | ||
|
||
curl -X POST -H 'Content-type:application/json' --data-binary '{ | ||
"add-dynamic-field": { | ||
"name": "*_t", | ||
"type": "text", | ||
"indexed": true, | ||
"stored": false, | ||
"multiValued": true | ||
} | ||
}' http://localhost:8983/solr/association/schema | ||
|
||
# One for autocomplete fields | ||
|
||
curl -X POST -H 'Content-type:application/json' --data-binary '{ | ||
"add-dynamic-field": { | ||
"name": "*_ac", | ||
"type": "autocomplete", | ||
"indexed": true, | ||
"stored": false, | ||
"multiValued": true | ||
} | ||
}' http://localhost:8983/solr/association/schema | ||
|
||
|
||
# now add copyfields declarations for subject_label, subject_closure_label, object_label, object_closure_label | ||
|
||
for field in subject_label subject_closure_label subject_taxon subject_taxon_label predicate object_label object_closure_label object_taxon object_taxon_label primary_knowledge_source in_taxon_label qualifier_label onset_qualifier_label frequency_qualifier_label sex_qualifier_label | ||
do | ||
curl -X POST -H 'Content-type:application/json' --data-binary "{ | ||
\"add-copy-field\": { | ||
\"source\":\"$field\", | ||
\"dest\": \"${field}_t\" | ||
} | ||
}" http://localhost:8983/solr/association/schema | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
for core in entity association | ||
do | ||
curl -X POST -H 'Content-type:application/json' -d @scripts/text-fieldtype.json http://localhost:8983/solr/$core/schema | ||
curl -X POST -H 'Content-type:application/json' -d @scripts/autocomplete-fieldtype.json http://localhost:8983/solr/$core/schema | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"add-field-type": { | ||
"name": "autocomplete", | ||
"class": "solr.TextField", | ||
"positionIncrementGap": "100", | ||
"indexAnalyzer": { | ||
"tokenizer": { "class": "solr.StandardTokenizerFactory" }, | ||
"filters": [ | ||
{ "class": "solr.ASCIIFoldingFilterFactory" }, | ||
{ "class": "solr.LowerCaseFilterFactory" }, | ||
{ | ||
"class": "solr.EdgeNGramFilterFactory", | ||
"minGramSize": "1", | ||
"maxGramSize": "25" | ||
} | ||
] | ||
}, | ||
"queryAnalyzer": { | ||
"tokenizer": { "class": "solr.StandardTokenizerFactory" }, | ||
"filters": [ | ||
{ "class": "solr.ASCIIFoldingFilterFactory" }, | ||
{ "class": "solr.LowerCaseFilterFactory" } | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters