diff --git a/scripts/add_entity_copyfields.sh b/scripts/add_entity_copyfields.sh index b8a300ad..5cab3e77 100755 --- a/scripts/add_entity_copyfields.sh +++ b/scripts/add_entity_copyfields.sh @@ -33,6 +33,17 @@ curl -X POST -H 'Content-type:application/json' --data-binary '{ } }' http://localhost:8983/solr/entity/schema +# Add a dynamic field for the grounding field type + +curl -X POST -H 'Content-type:application/json' --data-binary '{ + "add-dynamic-field": { + "name": "*_grounding", + "type": "grounding", + "indexed": true, + "stored": false, + "multiValued": true, + } +}' http://localhost:8983/solr/entity/schema # now add copyfields declarations for name, symbol and synonym @@ -52,6 +63,13 @@ curl -X POST -H 'Content-type:application/json' --data-binary '{ } }' http://localhost:8983/solr/entity/schema +curl -X POST -H 'Content-type:application/json' --data-binary '{ + "add-copy-field": { + "source": "name", + "dest": "name_grounding" + } +}' http://localhost:8983/solr/entity/schema + # symbol curl -X POST -H 'Content-type:application/json' --data-binary '{ @@ -68,6 +86,13 @@ curl -X POST -H 'Content-type:application/json' --data-binary '{ } }' http://localhost:8983/solr/entity/schema +curl -X POST -H 'Content-type:application/json' --data-binary '{ + "add-copy-field": { + "source": "symbol", + "dest": "symbol_grounding" + } +}' http://localhost:8983/solr/entity/schema + # synonym curl -X POST -H 'Content-type:application/json' --data-binary '{ @@ -84,6 +109,13 @@ curl -X POST -H 'Content-type:application/json' --data-binary '{ } }' http://localhost:8983/solr/entity/schema +curl -X POST -H 'Content-type:application/json' --data-binary '{ + "add-copy-field": { + "source": "synonym", + "dest": "synonym_grounding" + } +}' http://localhost:8983/solr/entity/schema + # taxon label curl -X POST -H 'Content-type:application/json' --data-binary '{ diff --git a/scripts/add_fieldtypes.sh b/scripts/add_fieldtypes.sh index 678d1147..085392cc 100755 --- a/scripts/add_fieldtypes.sh +++ b/scripts/add_fieldtypes.sh @@ -4,4 +4,5 @@ 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 + curl -X POST -H 'Content-type:application/json' -d @scripts/grounding-fieldtype.json http://localhost:8983/solr/$core/schema done diff --git a/scripts/grounding-fieldtype.json b/scripts/grounding-fieldtype.json new file mode 100644 index 00000000..4b5489be --- /dev/null +++ b/scripts/grounding-fieldtype.json @@ -0,0 +1,15 @@ +{ + "add-field-type": { + "name": "grounding", + "class": "solr.TextField", + "positionIncrementGap": "100", + "analyzer": { + "tokenizer": { + "class": "solr.KeywordTokenizerFactory" + }, + "filters": [ + { "class": "solr.LowerCaseFilterFactory" } + ] + } + } +}