Skip to content

Commit

Permalink
Updated ElasticSearch mapping scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mlichtenberg committed Jul 13, 2018
1 parent d88fb68 commit 3c9f455
Show file tree
Hide file tree
Showing 13 changed files with 321 additions and 119 deletions.
10 changes: 10 additions & 0 deletions ElasticSearch/AuthorsMappings.json → ElasticSearch/Authors.json
@@ -1,4 +1,14 @@
{
"settings": {
"analysis": {
"analyzer": {
"default": {
"tokenizer": "icu_tokenizer",
"filter": [ "lowercase", "icu_folding" ]
}
}
}
},
"author" : {
"properties" : {
"authorNames" : {
Expand Down
12 changes: 0 additions & 12 deletions ElasticSearch/AuthorsSettings.json

This file was deleted.

18 changes: 5 additions & 13 deletions ElasticSearch/BuildESIndex.sh
Expand Up @@ -2,34 +2,26 @@

sServer=$1
sIndex=$2
sDocType=$3
sSettings=$4
sMappings=$5
sSettings=$3

if [ $# -eq 5 ]
if [ $# -eq 3 ]
then
echo
echo Building index $sServer/$sIndex with settings in $sSettings
curl -X PUT $sServer/$sIndex -d @$sSettings --header "Content-Type:application/json"
echo
echo
echo Adding mappings for $sServer/$sIndex/_mapping/$sDocType with mappings in $sMappings
curl -X POST $sServer/$sIndex/_mapping/$sDocType -d @$sMappings --header "Content-Type:application/json"
echo
echo Done
else
echo
echo Usage
echo
echo BuildESIndex SERVER-NAME INDEX-NAME DOC-TYPE SETTINGS-FILENAME MAPPINGS-FILENAME
echo BuildESIndex SERVER-NAME INDEX-NAME SETTINGS-FILENAME
echo
echo SERVER-NAME is the name of the search server, including the port number
echo INDEX-NAME is the name of the index to be created
echo DOC-TYPE is the type of documents to be added to the index
echo SETTINGS-FILENAME is the name of a file containing index settings
echo MAPPINGS-FILENAME is the name of a file containing index mappings
echo SETTINGS-FILENAME is the name of a file containing index settings and mappings
echo
echo Example: BuildESIndex http://localhost:9200 items item ItemsSettings.json ItemsMappings.json
echo Example: BuildESIndex http://localhost:9200 items Items.json
echo
fi
echo
239 changes: 239 additions & 0 deletions ElasticSearch/Catalog.json
@@ -0,0 +1,239 @@
{
"settings": {
"analysis": {
"analyzer": {
"default": {
"tokenizer": "icu_tokenizer",
"filter": [ "lowercase", "icu_folding" ]
}
}
}
},
"mappings" : {
"catalogitem" : {
"properties" : {
"associations" : {
"type" : "text",
"analyzer" : "default"
},
"authors" : {
"type" : "keyword",
"index" : false
},
"collections" : {
"type" : "keyword",
"include_in_all" : false
},
"container" : {
"type" : "text",
"analyzer" : "default",
"fields" : {
"raw" : {
"type" : "keyword"
}
}
},
"contributors" : {
"type" : "text",
"analyzer" : "default",
"fields" : {
"raw" : {
"type" : "keyword"
}
},
"include_in_all" : false
},
"dateRanges" : {
"type" : "keyword",
"include_in_all" : false
},
"dates" : {
"type" : "keyword"
},
"doi" : {
"type" : "text",
"analyzer" : "standard",
"fields" : {
"raw" : {
"type" : "keyword"
}
}
},
"facetAuthors" : {
"type" : "keyword",
"index" : false
},
"genre" : {
"type" : "keyword",
"include_in_all" : false
},
"id" : {
"type" : "keyword",
"include_in_all" : false
},
"isbn" : {
"type" : "text",
"analyzer" : "standard",
"fields" : {
"raw" : {
"type" : "keyword"
}
}
},
"issn" : {
"type" : "text",
"analyzer" : "standard",
"fields" : {
"raw" : {
"type" : "keyword"
}
}
},
"issue" : {
"type" : "text",
"analyzer" : "default"
},
"itemId" : {
"type" : "long",
"include_in_all" : false
},
"keywords" : {
"type" : "text",
"analyzer" : "default",
"fields" : {
"raw" : {
"type" : "keyword"
}
}
},
"language" : {
"type" : "keyword",
"include_in_all" : false
},
"materialType" : {
"type" : "keyword",
"include_in_all" : false
},
"oclc" : {
"type" : "text",
"analyzer" : "standard",
"fields" : {
"raw" : {
"type" : "keyword"
}
}
},
"pageRange" : {
"type" : "keyword",
"index" : false
},
"publicationPlace" : {
"type" : "text",
"analyzer" : "default",
"fields" : {
"raw" : {
"type" : "keyword"
}
},
"include_in_all" : false
},
"publisher" : {
"type" : "text",
"analyzer" : "default",
"fields" : {
"raw" : {
"type" : "keyword"
}
},
"include_in_all" : false
},
"searchAuthors" : {
"type" : "text",
"analyzer" : "default"
},
"segmentId" : {
"type" : "long",
"include_in_all" : false
},
"series" : {
"type" : "text",
"analyzer" : "default"
},
"sortTitle" : {
"type" : "keyword",
"include_in_all" : false
},
"startPageId" : {
"type" : "long",
"include_in_all" : false
},
"title" : {
"type" : "text",
"analyzer" : "default",
"fields" : {
"raw" : {
"type" : "keyword"
}
}
},
"titleId" : {
"type" : "long",
"include_in_all" : false
},
"translatedTitle" : {
"type" : "text",
"analyzer" : "default"
},
"uniformTitle" : {
"type" : "text",
"analyzer" : "default"
},
"url" : {
"type" : "keyword",
"index" : false
},
"variants" : {
"type" : "text",
"analyzer" : "default"
},
"volume" : {
"type" : "text",
"analyzer" : "default"
},
"volumes": {
"type": "nested",
"properties": {
"id" : {
"type" : "keyword",
"include_in_all" : false
},
"itemId" : {
"type" : "long",
"include_in_all" : false
},
"volume" : {
"type" : "text",
"analyzer" : "default"
},
"date" : {
"type" : "keyword",
"include_in_all" : false
},
"hasExternalContent" : {
"type" : "boolean"
},
"hasIllustrations" : {
"type" : "boolean"
},
"hasLocalContent" : {
"type" : "boolean"
},
"hasSegments" : {
"type" : "boolean"
}
}
}
}
}
}
}
10 changes: 10 additions & 0 deletions ElasticSearch/ItemsMappings.json → ElasticSearch/Items.json
@@ -1,4 +1,14 @@
{
"settings": {
"analysis": {
"analyzer": {
"default": {
"tokenizer": "icu_tokenizer",
"filter": [ "lowercase", "icu_folding" ]
}
}
}
},
"item" : {
"properties" : {
"associations" : {
Expand Down
12 changes: 0 additions & 12 deletions ElasticSearch/ItemsSettings.json

This file was deleted.

@@ -1,4 +1,14 @@
{
"settings": {
"analysis": {
"analyzer": {
"default": {
"tokenizer": "icu_tokenizer",
"filter": [ "lowercase", "icu_folding" ]
}
}
}
},
"keyword" : {
"properties" : {
"id" : {
Expand Down
12 changes: 0 additions & 12 deletions ElasticSearch/KeywordsSettings.json

This file was deleted.

10 changes: 10 additions & 0 deletions ElasticSearch/NamesMappings.json → ElasticSearch/Names.json
@@ -1,4 +1,14 @@
{
"settings": {
"analysis": {
"analyzer": {
"default": {
"tokenizer": "icu_tokenizer",
"filter": [ "lowercase", "icu_folding" ]
}
}
}
},
"name" : {
"properties" : {
"count" : {
Expand Down
12 changes: 0 additions & 12 deletions ElasticSearch/NamesSettings.json

This file was deleted.

0 comments on commit 3c9f455

Please sign in to comment.