A search interface for data from the Politics of Patents case study (part of Copim WP6): this parses data from the archive of RTF files and provides additional data from the European Patent Office API. https://patents.copim.ac.uk
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

solr_import.sh 3.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/bash
  2. # @name: solr_import.sh
  3. # @version: 0.1
  4. # @creation_date: 2022-03-11
  5. # @license: The MIT License <https://opensource.org/licenses/MIT>
  6. # @author: Simon Bowie <ad7588@coventry.ac.uk>
  7. # @purpose: Runs imports of files into Solr indexes
  8. # @acknowledgements:
  9. # https://www.redhat.com/sysadmin/arguments-options-bash-scripts
  10. ############################################################
  11. # Subprograms #
  12. ############################################################
  13. License()
  14. {
  15. echo 'Copyright 2022 Simon Bowie <ad7588@coventry.ac.uk>'
  16. echo
  17. echo 'Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:'
  18. echo
  19. echo 'The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.'
  20. echo
  21. echo 'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.'
  22. }
  23. Help()
  24. {
  25. # Display Help
  26. echo "This script performs Solr import functions for different cores."
  27. echo
  28. echo "Syntax: solr_import.sh [-m|h|a|b]"
  29. echo "options:"
  30. echo "m Print the MIT License notification."
  31. echo "h Print this Help."
  32. echo "z Index all."
  33. echo "a Index ACTIVE folder."
  34. echo "e Index EXPANDING folder."
  35. echo "s Index SURVIVING folder."
  36. echo
  37. }
  38. Import()
  39. {
  40. docker exec -it solr solr create_core -c $core
  41. docker exec -ti --user=solr solr bash -c "cp -r /opt/solr/example/files/conf/* /var/solr/data/$core/conf/"
  42. docker restart solr
  43. sleep 30
  44. docker run --rm -v "/Users/ad7588/$location:/$core" --network=host solr:latest post -c $core /$core
  45. }
  46. ############################################################
  47. ############################################################
  48. # Main program #
  49. ############################################################
  50. ############################################################
  51. # Set variables
  52. # Get the options
  53. while getopts ":hmzaes" option; do
  54. case $option in
  55. m) # display License
  56. License
  57. exit;;
  58. h) # display Help
  59. Help
  60. exit;;
  61. z) # index all
  62. core="all"
  63. location="Downloads/2018 (10381)"
  64. Import
  65. exit;;
  66. a) # index ACTIVE folder
  67. core="active"
  68. location="Downloads/pop_rtfs/ACTIVE (160)"
  69. Import
  70. exit;;
  71. e) # index EXPANDING folder
  72. core="expanding"
  73. location="Downloads/pop_rtfs/EXPANDING (169)"
  74. Import
  75. exit;;
  76. s) # index SURVIVING folder
  77. core="surviving"
  78. location="Downloads/pop_rtfs/SURVIVING (166)"
  79. Import
  80. exit;;
  81. \?) # Invalid option
  82. echo "Error: Invalid option"
  83. exit;;
  84. esac
  85. done