active-fedora 1.0.5 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. data/.document +5 -0
  2. data/.gitignore +21 -0
  3. data/.hg/00changelog.i +0 -0
  4. data/.hg/branch +1 -0
  5. data/.hg/branch.cache +2 -0
  6. data/.hg/dirstate +0 -0
  7. data/.hg/hgrc +2 -0
  8. data/.hg/requires +2 -0
  9. data/.hg/store/00changelog.i +0 -0
  10. data/.hg/store/00manifest.i +0 -0
  11. data/.hg/store/data/.hgignore.i +0 -0
  12. data/.hg/store/data/.hgtags.i +0 -0
  13. data/.hg/store/data/_c_o_p_y_i_n_g.txt.i +0 -0
  14. data/.hg/store/data/_c_o_y_i_n_g._l_e_s_s_e_r.txt.i +0 -0
  15. data/.hg/store/data/_history.txt.i +0 -0
  16. data/.hg/store/data/_license.txt.i +0 -0
  17. data/.hg/store/data/_manifest.txt.i +0 -0
  18. data/.hg/store/data/_post_install.txt.i +0 -0
  19. data/.hg/store/data/_r_e_a_d_m_e.rdoc.i +0 -0
  20. data/.hg/store/data/_r_e_a_d_m_e.txt.i +0 -0
  21. data/.hg/store/data/_rakefile.i +0 -0
  22. data/.hg/store/data/_v_e_r_s_i_o_n.i +0 -0
  23. data/.hg/store/data/active-fedora.gemspec.i +0 -0
  24. data/.hg/store/data/active__fedora/_history.txt.i +0 -0
  25. data/.hg/store/data/active__fedora/_manifest.txt.i +0 -0
  26. data/.hg/store/data/active__fedora/_post_install.txt.i +0 -0
  27. data/.hg/store/data/active__fedora/_r_e_a_d_m_e.rdoc.i +0 -0
  28. data/.hg/store/data/active__fedora/_rakefile.i +0 -0
  29. data/.hg/store/data/active__fedora/lib/active__fedora.rb.i +0 -0
  30. data/.hg/store/data/active__fedora/script/console.i +0 -0
  31. data/.hg/store/data/active__fedora/script/destroy.i +0 -0
  32. data/.hg/store/data/active__fedora/script/generate.i +0 -0
  33. data/.hg/store/data/active__fedora/spec/active__fedora__spec.rb.i +0 -0
  34. data/.hg/store/data/active__fedora/spec/spec__helper.rb.i +0 -0
  35. data/.hg/store/data/config/fedora.yml.i +0 -0
  36. data/.hg/store/data/config/solr__mappings.yml.i +0 -0
  37. data/.hg/store/data/config/solr__mappings__af__0.1.yml.i +0 -0
  38. data/.hg/store/data/config/solr__mappings__bl__2.4.yml.i +0 -0
  39. data/.hg/store/data/lib/active-fedora.rb.i +0 -0
  40. data/.hg/store/data/lib/active__fedora.rb.i +0 -0
  41. data/.hg/store/data/lib/active__fedora/base.rb.i +0 -0
  42. data/.hg/store/data/lib/active__fedora/content__model.rb.i +0 -0
  43. data/.hg/store/data/lib/active__fedora/datastream.rb.i +0 -0
  44. data/.hg/store/data/lib/active__fedora/fedora__object.rb.i +0 -0
  45. data/.hg/store/data/lib/active__fedora/metadata__datastream.rb.i +0 -0
  46. data/.hg/store/data/lib/active__fedora/model.rb.i +0 -0
  47. data/.hg/store/data/lib/active__fedora/property.rb.i +0 -0
  48. data/.hg/store/data/lib/active__fedora/qualified__dublin__core__datastream.rb.i +0 -0
  49. data/.hg/store/data/lib/active__fedora/relationship.rb.i +0 -0
  50. data/.hg/store/data/lib/active__fedora/rels__ext__datastream.rb.i +0 -0
  51. data/.hg/store/data/lib/active__fedora/semantic__node.rb.i +0 -0
  52. data/.hg/store/data/lib/active__fedora/solr__mapper.rb.i +0 -0
  53. data/.hg/store/data/lib/active__fedora/solr__service.rb.i +0 -0
  54. data/.hg/store/data/lib/fedora/base.rb.i +0 -0
  55. data/.hg/store/data/lib/fedora/connection.rb.i +0 -0
  56. data/.hg/store/data/lib/fedora/datastream.rb.i +0 -0
  57. data/.hg/store/data/lib/fedora/fedora__object.rb.i +0 -0
  58. data/.hg/store/data/lib/fedora/formats.rb.i +0 -0
  59. data/.hg/store/data/lib/fedora/generic__search.rb.i +0 -0
  60. data/.hg/store/data/lib/fedora/repository.rb.i +0 -0
  61. data/.hg/store/data/lib/ruby-fedora.rb.i +0 -0
  62. data/.hg/store/data/lib/util/class__level__inheritable__attributes.rb.i +0 -0
  63. data/.hg/store/data/script/console.i +0 -0
  64. data/.hg/store/data/script/destroy.i +0 -0
  65. data/.hg/store/data/script/generate.i +0 -0
  66. data/.hg/store/data/solr/config/schema-1.5.xml.i +0 -0
  67. data/.hg/store/data/solr/config/schema.xml.i +0 -0
  68. data/.hg/store/data/solr/config/solrconfig-1.5.xml.i +0 -0
  69. data/.hg/store/data/spec/fixtures/changeme155.xml.i +0 -0
  70. data/.hg/store/data/spec/fixtures/dino.jpg.i +0 -0
  71. data/.hg/store/data/spec/fixtures/minivan.jpg.d +0 -0
  72. data/.hg/store/data/spec/fixtures/minivan.jpg.i +0 -0
  73. data/.hg/store/data/spec/fixtures/test__12.foxml.xml.i +0 -0
  74. data/.hg/store/data/spec/integration/active__fedora/base__spec.rb.i +0 -0
  75. data/.hg/store/data/spec/integration/active__fedora/datastream__spec.rb.i +0 -0
  76. data/.hg/store/data/spec/integration/active__fedora/fedora__object__spec.rb.i +0 -0
  77. data/.hg/store/data/spec/integration/active__fedora/full__featured__model__spec.rb.i +0 -0
  78. data/.hg/store/data/spec/integration/active__fedora/model__spec.rb.i +0 -0
  79. data/.hg/store/data/spec/integration/active__fedora/rels__ext__datastream__spec.rb.i +0 -0
  80. data/.hg/store/data/spec/integration/active__fedora/semantic__node__spec.rb.i +0 -0
  81. data/.hg/store/data/spec/integration/base__file__management__spec.rb.i +0 -0
  82. data/.hg/store/data/spec/integration/base__spec.rb.i +0 -0
  83. data/.hg/store/data/spec/integration/bug__spec.rb.i +0 -0
  84. data/.hg/store/data/spec/integration/datastream__spec.rb.i +0 -0
  85. data/.hg/store/data/spec/integration/datastreams__crud__spec.rb.i +0 -0
  86. data/.hg/store/data/spec/integration/fedora__object__spec.rb.i +0 -0
  87. data/.hg/store/data/spec/integration/full__featured__model__spec.rb.i +0 -0
  88. data/.hg/store/data/spec/integration/model__spec.rb.i +0 -0
  89. data/.hg/store/data/spec/integration/rels__ext__datastream__spec.rb.i +0 -0
  90. data/.hg/store/data/spec/integration/repository__spec.rb.i +0 -0
  91. data/.hg/store/data/spec/integration/rf__fedora__object__spec.rb.i +0 -0
  92. data/.hg/store/data/spec/integration/semantic__node__spec.rb.i +0 -0
  93. data/.hg/store/data/spec/integration/solr__service__spec.rb.i +0 -0
  94. data/.hg/store/data/spec/samples/models/audio__record.rb.i +0 -0
  95. data/.hg/store/data/spec/samples/models/image.rb.i +0 -0
  96. data/.hg/store/data/spec/samples/models/oral__history.rb.i +0 -0
  97. data/.hg/store/data/spec/samples/models/seminar.rb.i +0 -0
  98. data/.hg/store/data/spec/samples/models/seminar__audio__file.rb.i +0 -0
  99. data/.hg/store/data/spec/samples/oh__qdc.xml.i +0 -0
  100. data/.hg/store/data/spec/samples/oral__history.rb.i +0 -0
  101. data/.hg/store/data/spec/samples/oral__history__sample.xml.i +0 -0
  102. data/.hg/store/data/spec/samples/oral__history__sample__model.rb.i +0 -0
  103. data/.hg/store/data/spec/samples/oral__history__xml.xml.i +0 -0
  104. data/.hg/store/data/spec/spec.opts.i +0 -0
  105. data/.hg/store/data/spec/spec__helper.rb.i +0 -0
  106. data/.hg/store/data/spec/unit/active__fedora/base__cma__spec.rb.i +0 -0
  107. data/.hg/store/data/spec/unit/active__fedora/base__extra__spec.rb.i +0 -0
  108. data/.hg/store/data/spec/unit/active__fedora/base__spec.rb.i +0 -0
  109. data/.hg/store/data/spec/unit/active__fedora/content__model__spec.rb.i +0 -0
  110. data/.hg/store/data/spec/unit/active__fedora/datastream__spec.rb.i +0 -0
  111. data/.hg/store/data/spec/unit/active__fedora/inheritance__spec.rb.i +0 -0
  112. data/.hg/store/data/spec/unit/active__fedora/metadata__datastream__spec.rb.i +0 -0
  113. data/.hg/store/data/spec/unit/active__fedora/model__spec.rb.i +0 -0
  114. data/.hg/store/data/spec/unit/active__fedora/property__spec.rb.i +0 -0
  115. data/.hg/store/data/spec/unit/active__fedora/qualified__dublin__core__datastream__spec.rb.i +0 -0
  116. data/.hg/store/data/spec/unit/active__fedora/relationship__spec.rb.i +0 -0
  117. data/.hg/store/data/spec/unit/active__fedora/rels__ext__datastream__spec.rb.i +0 -0
  118. data/.hg/store/data/spec/unit/active__fedora/semantic__node__spec.rb.i +0 -0
  119. data/.hg/store/data/spec/unit/active__fedora/solr__service__spec.rb.i +0 -0
  120. data/.hg/store/data/spec/unit/active__fedora__spec.rb.i +0 -0
  121. data/.hg/store/data/spec/unit/base__cma__spec.rb.i +0 -0
  122. data/.hg/store/data/spec/unit/base__datastream__management__spec.rb.i +0 -0
  123. data/.hg/store/data/spec/unit/base__extra__spec.rb.i +0 -0
  124. data/.hg/store/data/spec/unit/base__file__management__spec.rb.i +0 -0
  125. data/.hg/store/data/spec/unit/base__loader__spec.rb.i +0 -0
  126. data/.hg/store/data/spec/unit/base__spec.rb.i +0 -0
  127. data/.hg/store/data/spec/unit/connection__spec.rb.i +0 -0
  128. data/.hg/store/data/spec/unit/content__model__spec.rb.i +0 -0
  129. data/.hg/store/data/spec/unit/datastream__concurrency__spec.rb.i +0 -0
  130. data/.hg/store/data/spec/unit/datastream__spec.rb.i +0 -0
  131. data/.hg/store/data/spec/unit/fedora__object__spec.rb.i +0 -0
  132. data/.hg/store/data/spec/unit/inheritance__spec.rb.i +0 -0
  133. data/.hg/store/data/spec/unit/metadata__datastream__spec.rb.i +0 -0
  134. data/.hg/store/data/spec/unit/model__spec.rb.i +0 -0
  135. data/.hg/store/data/spec/unit/property__spec.rb.i +0 -0
  136. data/.hg/store/data/spec/unit/qualified__dublin__core__datastream__spec.rb.i +0 -0
  137. data/.hg/store/data/spec/unit/relationship__spec.rb.i +0 -0
  138. data/.hg/store/data/spec/unit/rels__ext__datastream__spec.rb.i +0 -0
  139. data/.hg/store/data/spec/unit/repository__spec.rb.i +0 -0
  140. data/.hg/store/data/spec/unit/rf__datastream__spec.rb.i +0 -0
  141. data/.hg/store/data/spec/unit/semantic__node__spec.rb.i +0 -0
  142. data/.hg/store/data/spec/unit/solr__config__options__spec.rb.i +0 -0
  143. data/.hg/store/data/spec/unit/solr__mapper__spec.rb.i +0 -0
  144. data/.hg/store/data/spec/unit/solr__service__spec.rb.i +0 -0
  145. data/.hg/store/data/tasks/rspec.rake.i +0 -0
  146. data/.hg/store/undo +0 -0
  147. data/.hg/undo.branch +1 -0
  148. data/.hg/undo.dirstate +0 -0
  149. data/.hgignore +7 -0
  150. data/.hgtags +14 -0
  151. data/COPYING.txt +674 -0
  152. data/COYING.LESSER.txt +165 -0
  153. data/History.txt +34 -0
  154. data/LICENSE +20 -0
  155. data/License.txt +58 -0
  156. data/Manifest.txt +1 -1
  157. data/README.rdoc +13 -54
  158. data/README.txt +59 -0
  159. data/Rakefile +35 -0
  160. data/VERSION +1 -0
  161. data/active-fedora.gemspec +359 -0
  162. data/config/fedora.yml +16 -0
  163. data/config/solr_mappings.yml +14 -0
  164. data/config/solr_mappings_af_0.1.yml +16 -0
  165. data/config/solr_mappings_bl_2.4.yml +14 -0
  166. data/lib/active_fedora.rb +66 -6
  167. data/lib/active_fedora/base.rb +59 -23
  168. data/lib/active_fedora/datastream.rb +1 -1
  169. data/lib/active_fedora/metadata_datastream.rb +14 -7
  170. data/lib/active_fedora/model.rb +4 -4
  171. data/lib/active_fedora/rels_ext_datastream.rb +1 -1
  172. data/lib/active_fedora/semantic_node.rb +4 -3
  173. data/lib/active_fedora/solr_mapper.rb +17 -0
  174. data/lib/active_fedora/solr_service.rb +44 -2
  175. data/lib/fedora/base.rb +38 -0
  176. data/lib/fedora/connection.rb +210 -0
  177. data/lib/fedora/datastream.rb +56 -0
  178. data/lib/fedora/fedora_object.rb +161 -0
  179. data/lib/fedora/formats.rb +30 -0
  180. data/lib/fedora/generic_search.rb +71 -0
  181. data/lib/fedora/repository.rb +287 -0
  182. data/lib/ruby-fedora.rb +20 -0
  183. data/lib/util/class_level_inheritable_attributes.rb +23 -0
  184. data/script/console +15 -0
  185. data/script/destroy +14 -0
  186. data/script/generate +14 -0
  187. data/solr/config/schema-1.5.xml +468 -0
  188. data/solr/config/schema.xml +174 -212
  189. data/solr/config/solrconfig-1.5.xml +1069 -0
  190. data/spec/active_fedora_spec.rb +7 -0
  191. data/spec/fixtures/changeme155.xml +255 -0
  192. data/spec/fixtures/dino.jpg +0 -0
  193. data/spec/fixtures/minivan.jpg +0 -0
  194. data/spec/fixtures/test_12.foxml.xml +121 -0
  195. data/spec/integration/base_file_management_spec.rb +20 -0
  196. data/spec/integration/base_spec.rb +196 -0
  197. data/spec/integration/bug_spec.rb +57 -0
  198. data/spec/integration/datastream_spec.rb +60 -0
  199. data/spec/integration/datastreams_crud_spec.rb +208 -0
  200. data/spec/integration/fedora_object_spec.rb +77 -0
  201. data/spec/integration/full_featured_model_spec.rb +207 -0
  202. data/spec/integration/model_spec.rb +54 -0
  203. data/spec/integration/rels_ext_datastream_spec.rb +67 -0
  204. data/spec/integration/repository_spec.rb +297 -0
  205. data/spec/integration/rf_fedora_object_spec.rb +95 -0
  206. data/spec/integration/semantic_node_spec.rb +95 -0
  207. data/spec/integration/solr_service_spec.rb +33 -0
  208. data/spec/samples/models/audio_record.rb +29 -0
  209. data/spec/samples/models/image.rb +5 -0
  210. data/spec/samples/models/oral_history.rb +50 -0
  211. data/spec/samples/models/seminar.rb +29 -0
  212. data/spec/samples/models/seminar_audio_file.rb +34 -0
  213. data/spec/samples/oh_qdc.xml +32 -0
  214. data/spec/samples/oral_history_sample.xml +38 -0
  215. data/spec/samples/oral_history_sample_model.rb +39 -0
  216. data/spec/samples/oral_history_xml.xml +35 -0
  217. data/spec/spec.opts +5 -0
  218. data/spec/spec_helper.rb +41 -0
  219. data/spec/unit/active_fedora_spec.rb +15 -0
  220. data/spec/unit/base_cma_spec.rb +25 -0
  221. data/spec/unit/base_datastream_management_spec.rb +119 -0
  222. data/spec/unit/base_extra_spec.rb +108 -0
  223. data/spec/unit/base_file_management_spec.rb +90 -0
  224. data/spec/unit/base_loader_spec.rb +43 -0
  225. data/spec/unit/base_spec.rb +584 -0
  226. data/spec/unit/connection_spec.rb +25 -0
  227. data/spec/unit/content_model_spec.rb +51 -0
  228. data/spec/unit/datastream_concurrency_spec.rb +59 -0
  229. data/spec/unit/datastream_spec.rb +85 -0
  230. data/spec/unit/fedora_object_spec.rb +66 -0
  231. data/spec/unit/inheritance_spec.rb +46 -0
  232. data/spec/unit/metadata_datastream_spec.rb +290 -0
  233. data/spec/unit/model_spec.rb +186 -0
  234. data/spec/unit/property_spec.rb +50 -0
  235. data/spec/unit/qualified_dublin_core_datastream_spec.rb +177 -0
  236. data/spec/unit/relationship_spec.rb +77 -0
  237. data/spec/unit/rels_ext_datastream_spec.rb +99 -0
  238. data/spec/unit/repository_spec.rb +136 -0
  239. data/spec/unit/rf_datastream_spec.rb +49 -0
  240. data/spec/unit/semantic_node_spec.rb +354 -0
  241. data/spec/unit/solr_config_options_spec.rb +98 -0
  242. data/spec/unit/solr_mapper_spec.rb +31 -0
  243. data/spec/unit/solr_service_spec.rb +83 -0
  244. data/tasks/hoe.rake +0 -0
  245. data/tasks/rspec.rake +29 -0
  246. metadata +373 -55
@@ -0,0 +1,20 @@
1
+ require 'rubygems'
2
+ gem 'xml-simple'
3
+ $LOAD_PATH.unshift File.dirname(__FILE__) unless
4
+ $LOAD_PATH.include?(File.dirname(__FILE__)) || $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
5
+ module Fedora #:nodoc:
6
+ end
7
+ #extended to remove facets dep
8
+ class Hash
9
+ def rekey!
10
+ self.each {|k,v| self[k.to_sym]=v; self.delete(k) unless self[k.to_sym]}
11
+ end
12
+ end
13
+ require 'fedora/base'
14
+ require 'fedora/connection'
15
+ require 'fedora/datastream'
16
+ require 'fedora/fedora_object'
17
+ require 'fedora/formats'
18
+ require 'fedora/generic_search'
19
+ require 'fedora/repository'
20
+ require 'util/class_level_inheritable_attributes'
@@ -0,0 +1,23 @@
1
+ module MediaShelfClassLevelInheritableAttributes
2
+ def self.included(base)
3
+ base.extend(MSClassMethods)
4
+ end
5
+ module MSClassMethods
6
+ def ms_inheritable_attributes(*args)
7
+ @ms_inheritable_attributes ||=[:ms_inheritable_attributes]
8
+ @ms_inheritable_attributes+=args
9
+ args.each do |arg|
10
+ class_eval %(
11
+ class <<self;attr_accessor :#{arg} end
12
+ )
13
+ end
14
+ @ms_inheritable_attributes
15
+ end
16
+ def inherited(subclass)
17
+ @ms_inheritable_attributes.each do |attrib|
18
+ instance_var = "@#{attrib}"
19
+ subclass.instance_variable_set(instance_var, instance_variable_get(instance_var))
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # File: script/console
3
+ irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
+
5
+ libs = " -r irb/completion"
6
+ libs << " -r #{File.dirname(__FILE__) + '/../spec/spec_helper'}"
7
+ #libs << " -r rubygems"
8
+ # libs << " -r #{File.dirname(__FILE__) + '/../lib/active_fedora.rb'}"
9
+
10
+ # Perhaps use a console_lib to store any extra methods I may want available in the cosole
11
+ # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
12
+ # libs << " -r #{File.dirname(__FILE__) + '/../lib/afed-regem.rb'}"
13
+ # puts "Loading afed-regem gem"
14
+ exec "#{irb} #{libs} --simple-prompt"
15
+
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/destroy'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Destroy.new.run(ARGV)
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/generate'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Generate.new.run(ARGV)
@@ -0,0 +1,468 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ -->
18
+
19
+ <!--
20
+ This is the Solr schema file. This file should be named "schema.xml" and
21
+ should be in the conf directory under the solr home
22
+ (i.e. ./solr/conf/schema.xml by default)
23
+ or located where the classloader for the Solr webapp can find it.
24
+
25
+ This example schema is the recommended starting point for users.
26
+ It should be kept correct and concise, usable out-of-the-box.
27
+
28
+ For more information, on how to customize this file, please see
29
+ http://wiki.apache.org/solr/SchemaXml
30
+
31
+ PERFORMANCE NOTE: this schema includes many optional features and should not
32
+ be used for benchmarking. To improve performance one could
33
+ - set stored="false" for all fields possible (esp large fields) when you
34
+ only need to search on the field but don't need to return the original
35
+ value.
36
+ - set indexed="false" if you don't need to search on the field, but only
37
+ return the field as a result of searching on other indexed fields.
38
+ - remove all unneeded copyField statements
39
+ - for best index size and searching performance, set "index" to false
40
+ for all general text fields, use copyField to copy them to the
41
+ catchall "text" field, and use that for searching.
42
+ - For maximum indexing performance, use the StreamingUpdateSolrServer
43
+ java client.
44
+ - Remember to run the JVM in server mode, and use a higher logging level
45
+ that avoids logging every request
46
+ -->
47
+
48
+ <schema name="active-fedora" version="1.9">
49
+ <!-- attribute "name" is the name of this schema and is only used for display purposes.
50
+ Applications should change this to reflect the nature of the search collection.
51
+ version="1.2" is Solr's version number for the schema syntax and semantics. It should
52
+ not normally be changed by applications.
53
+ 1.0: multiValued attribute did not exist, all fields are multiValued by nature
54
+ 1.1: multiValued attribute introduced, false by default
55
+ 1.2: omitTermFreqAndPositions attribute introduced, true by default except for text fields.
56
+ -->
57
+
58
+ <types>
59
+ <!-- field type definitions. The "name" attribute is
60
+ just a label to be used by field definitions. The "class"
61
+ attribute and any other attributes determine the real
62
+ behavior of the fieldType.
63
+ Class names starting with "solr" refer to java classes in the
64
+ org.apache.solr.analysis package.
65
+ -->
66
+
67
+ <!-- The StrField type is not analyzed, but indexed/stored verbatim.
68
+ - StrField and TextField support an optional compressThreshold which
69
+ limits compression (if enabled in the derived fields) to values which
70
+ exceed a certain size (in characters).
71
+ -->
72
+ <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
73
+
74
+ <!-- boolean type: "true" or "false" -->
75
+ <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
76
+ <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
77
+ <fieldtype name="binary" class="solr.BinaryField"/>
78
+
79
+ <!-- The optional sortMissingLast and sortMissingFirst attributes are
80
+ currently supported on types that are sorted internally as strings.
81
+ This includes "string","boolean","sint","slong","sfloat","sdouble","pdate"
82
+ - If sortMissingLast="true", then a sort on this field will cause documents
83
+ without the field to come after documents with the field,
84
+ regardless of the requested sort order (asc or desc).
85
+ - If sortMissingFirst="true", then a sort on this field will cause documents
86
+ without the field to come before documents with the field,
87
+ regardless of the requested sort order.
88
+ - If sortMissingLast="false" and sortMissingFirst="false" (the default),
89
+ then default lucene sorting will be used which places docs without the
90
+ field first in an ascending sort and last in a descending sort.
91
+ -->
92
+
93
+ <!--
94
+ Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
95
+ -->
96
+ <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
97
+ <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
98
+ <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
99
+ <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
100
+
101
+ <!--
102
+ Numeric field types that index each value at various levels of precision
103
+ to accelerate range queries when the number of values between the range
104
+ endpoints is large. See the javadoc for NumericRangeQuery for internal
105
+ implementation details.
106
+
107
+ Smaller precisionStep values (specified in bits) will lead to more tokens
108
+ indexed per value, slightly larger index size, and faster range queries.
109
+ A precisionStep of 0 disables indexing at different precision levels.
110
+ -->
111
+ <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
112
+ <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
113
+ <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
114
+ <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
115
+
116
+ <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
117
+ is a more restricted form of the canonical representation of dateTime
118
+ http://www.w3.org/TR/xmlschema-2/#dateTime
119
+ The trailing "Z" designates UTC time and is mandatory.
120
+ Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
121
+ All other components are mandatory.
122
+
123
+ Expressions can also be used to denote calculations that should be
124
+ performed relative to "NOW" to determine the value, ie...
125
+
126
+ NOW/HOUR
127
+ ... Round to the start of the current hour
128
+ NOW-1DAY
129
+ ... Exactly 1 day prior to now
130
+ NOW/DAY+6MONTHS+3DAYS
131
+ ... 6 months and 3 days in the future from the start of
132
+ the current day
133
+
134
+ Consult the DateField javadocs for more information.
135
+
136
+ Note: For faster range queries, consider the tdate type
137
+ -->
138
+ <fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
139
+
140
+ <!-- A Trie based date field for faster date range queries and date faceting. -->
141
+ <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
142
+
143
+
144
+ <!--
145
+ Note:
146
+ These should only be used for compatibility with existing indexes (created with older Solr versions)
147
+ or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
148
+
149
+ Plain numeric field types that store and index the text
150
+ value verbatim (and hence don't support range queries, since the
151
+ lexicographic ordering isn't equal to the numeric ordering)
152
+ -->
153
+ <fieldType name="pint" class="solr.IntField" omitNorms="true"/>
154
+ <fieldType name="plong" class="solr.LongField" omitNorms="true"/>
155
+ <fieldType name="pfloat" class="solr.FloatField" omitNorms="true"/>
156
+ <fieldType name="pdouble" class="solr.DoubleField" omitNorms="true"/>
157
+ <fieldType name="pdate" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>
158
+
159
+
160
+ <!--
161
+ Note:
162
+ These should only be used for compatibility with existing indexes (created with older Solr versions)
163
+ or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
164
+
165
+ Numeric field types that manipulate the value into
166
+ a string value that isn't human-readable in its internal form,
167
+ but with a lexicographic ordering the same as the numeric ordering,
168
+ so that range queries work correctly.
169
+ -->
170
+ <fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
171
+ <fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
172
+ <fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
173
+ <fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>
174
+
175
+
176
+ <!-- The "RandomSortField" is not used to store or search any
177
+ data. You can declare fields of this type it in your schema
178
+ to generate pseudo-random orderings of your docs for sorting
179
+ purposes. The ordering is generated based on the field name
180
+ and the version of the index, As long as the index version
181
+ remains unchanged, and the same field name is reused,
182
+ the ordering of the docs will be consistent.
183
+ If you want different psuedo-random orderings of documents,
184
+ for the same version of the index, use a dynamicField and
185
+ change the name
186
+ -->
187
+ <fieldType name="random" class="solr.RandomSortField" indexed="true" />
188
+
189
+ <!-- solr.TextField allows the specification of custom text analyzers
190
+ specified as a tokenizer and a list of token filters. Different
191
+ analyzers may be specified for indexing and querying.
192
+
193
+ The optional positionIncrementGap puts space between multiple fields of
194
+ this type on the same document, with the purpose of preventing false phrase
195
+ matching across fields.
196
+
197
+ For more info on customizing your analyzer chain, please see
198
+ http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
199
+ -->
200
+
201
+ <!-- One can also specify an existing Analyzer class that has a
202
+ default constructor via the class attribute on the analyzer element
203
+ <fieldType name="text_greek" class="solr.TextField">
204
+ <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
205
+ </fieldType>
206
+ -->
207
+
208
+ <!-- A text field that only splits on whitespace for exact matching of words -->
209
+ <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
210
+ <analyzer>
211
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
212
+ </analyzer>
213
+ </fieldType>
214
+
215
+ <!-- A text field that uses WordDelimiterFilter to enable splitting and matching of
216
+ words on case-change, alpha numeric boundaries, and non-alphanumeric chars,
217
+ so that a query of "wifi" or "wi fi" could match a document containing "Wi-Fi".
218
+ Synonyms and stopwords are customized by external files, and stemming is enabled.
219
+ -->
220
+ <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
221
+ <analyzer type="index">
222
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
223
+ <!-- in this example, we will only use synonyms at query time
224
+ <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
225
+ -->
226
+ <!-- Case insensitive stop word removal.
227
+ add enablePositionIncrements=true in both the index and query
228
+ analyzers to leave a 'gap' for more accurate phrase queries.
229
+ -->
230
+ <filter class="solr.StopFilterFactory"
231
+ ignoreCase="true"
232
+ words="stopwords.txt"
233
+ enablePositionIncrements="true"
234
+ />
235
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
236
+ <filter class="solr.LowerCaseFilterFactory"/>
237
+ <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
238
+ </analyzer>
239
+ <analyzer type="query">
240
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
241
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
242
+ <filter class="solr.StopFilterFactory"
243
+ ignoreCase="true"
244
+ words="stopwords.txt"
245
+ enablePositionIncrements="true"
246
+ />
247
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
248
+ <filter class="solr.LowerCaseFilterFactory"/>
249
+ <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
250
+ </analyzer>
251
+ </fieldType>
252
+
253
+
254
+ <!-- Less flexible matching, but less false matches. Probably not ideal for product names,
255
+ but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
256
+ <fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" >
257
+ <analyzer>
258
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
259
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
260
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
261
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
262
+ <filter class="solr.LowerCaseFilterFactory"/>
263
+ <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
264
+ <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
265
+ possible with WordDelimiterFilter in conjuncton with stemming. -->
266
+ <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
267
+ </analyzer>
268
+ </fieldType>
269
+
270
+
271
+ <!-- A general unstemmed text field - good if one does not know the language of the field -->
272
+ <fieldType name="textgen" class="solr.TextField" positionIncrementGap="100">
273
+ <analyzer type="index">
274
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
275
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
276
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
277
+ <filter class="solr.LowerCaseFilterFactory"/>
278
+ </analyzer>
279
+ <analyzer type="query">
280
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
281
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
282
+ <filter class="solr.StopFilterFactory"
283
+ ignoreCase="true"
284
+ words="stopwords.txt"
285
+ enablePositionIncrements="true"
286
+ />
287
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
288
+ <filter class="solr.LowerCaseFilterFactory"/>
289
+ </analyzer>
290
+ </fieldType>
291
+
292
+
293
+ <!-- A general unstemmed text field that indexes tokens normally and also
294
+ reversed (via ReversedWildcardFilterFactory), to enable more efficient
295
+ leading wildcard queries. -->
296
+ <fieldType name="text_rev" class="solr.TextField" positionIncrementGap="100">
297
+ <analyzer type="index">
298
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
299
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
300
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
301
+ <filter class="solr.LowerCaseFilterFactory"/>
302
+ <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
303
+ maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
304
+ </analyzer>
305
+ <analyzer type="query">
306
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
307
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
308
+ <filter class="solr.StopFilterFactory"
309
+ ignoreCase="true"
310
+ words="stopwords.txt"
311
+ enablePositionIncrements="true"
312
+ />
313
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
314
+ <filter class="solr.LowerCaseFilterFactory"/>
315
+ </analyzer>
316
+ </fieldType>
317
+
318
+ <!-- charFilter + WhitespaceTokenizer -->
319
+ <!--
320
+ <fieldType name="textCharNorm" class="solr.TextField" positionIncrementGap="100" >
321
+ <analyzer>
322
+ <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
323
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
324
+ </analyzer>
325
+ </fieldType>
326
+ -->
327
+
328
+ <!-- This is an example of using the KeywordTokenizer along
329
+ With various TokenFilterFactories to produce a sortable field
330
+ that does not include some properties of the source text
331
+ -->
332
+ <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
333
+ <analyzer>
334
+ <!-- KeywordTokenizer does no actual tokenizing, so the entire
335
+ input string is preserved as a single token
336
+ -->
337
+ <tokenizer class="solr.KeywordTokenizerFactory"/>
338
+ <!-- The LowerCase TokenFilter does what you expect, which can be
339
+ when you want your sorting to be case insensitive
340
+ -->
341
+ <filter class="solr.LowerCaseFilterFactory" />
342
+ <!-- The TrimFilter removes any leading or trailing whitespace -->
343
+ <filter class="solr.TrimFilterFactory" />
344
+ <!-- The PatternReplaceFilter gives you the flexibility to use
345
+ Java Regular expression to replace any sequence of characters
346
+ matching a pattern with an arbitrary replacement string,
347
+ which may include back references to portions of the original
348
+ string matched by the pattern.
349
+
350
+ See the Java Regular Expression documentation for more
351
+ information on pattern and replacement string syntax.
352
+
353
+ http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
354
+ -->
355
+ <filter class="solr.PatternReplaceFilterFactory"
356
+ pattern="([^a-z])" replacement="" replace="all"
357
+ />
358
+ </analyzer>
359
+ </fieldType>
360
+
361
+ <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
362
+ <analyzer>
363
+ <tokenizer class="solr.StandardTokenizerFactory"/>
364
+ <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
365
+ </analyzer>
366
+ </fieldtype>
367
+
368
+ <fieldtype name="payloads" stored="false" indexed="true" class="solr.TextField" >
369
+ <analyzer>
370
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
371
+ <!--
372
+ The DelimitedPayloadTokenFilter can put payloads on tokens... for example,
373
+ a token of "foo|1.4" would be indexed as "foo" with a payload of 1.4f
374
+ Attributes of the DelimitedPayloadTokenFilterFactory :
375
+ "delimiter" - a one character delimiter. Default is | (pipe)
376
+ "encoder" - how to encode the following value into a playload
377
+ float -> org.apache.lucene.analysis.payloads.FloatEncoder,
378
+ integer -> o.a.l.a.p.IntegerEncoder
379
+ identity -> o.a.l.a.p.IdentityEncoder
380
+ Fully Qualified class name implementing PayloadEncoder, Encoder must have a no arg constructor.
381
+ -->
382
+ <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
383
+ </analyzer>
384
+ </fieldtype>
385
+
386
+ <!-- lowercases the entire field value, keeping it as a single token. -->
387
+ <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
388
+ <analyzer>
389
+ <tokenizer class="solr.KeywordTokenizerFactory"/>
390
+ <filter class="solr.LowerCaseFilterFactory" />
391
+ </analyzer>
392
+ </fieldType>
393
+
394
+
395
+ <!-- since fields of this type are by default not stored or indexed,
396
+ any data added to them will be ignored outright. -->
397
+ <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
398
+
399
+ <!-- This point type indexes the coordinates as separate fields (subFields)
400
+ If subFieldType is defined, it references a type, and a dynamic field
401
+ definition is created matching *___<typename>. Alternately, if
402
+ subFieldSuffix is defined, that is used to create the subFields.
403
+ Example: if subFieldType="double", then the coordinates would be
404
+ indexed in fields myloc_0___double,myloc_1___double.
405
+ Example: if subFieldSuffix="_d" then the coordinates would be indexed
406
+ in fields myloc_0_d,myloc_1_d
407
+ The subFields are an implementation detail of the fieldType, and end
408
+ users normally should not need to know about them.
409
+ -->
410
+ <fieldType name="location" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
411
+
412
+ <!--
413
+ A Geohash is a compact representation of a latitude longitude pair in a single field.
414
+
415
+ See http://wiki.apache.org/solr/SpatialSearch
416
+ -->
417
+ <fieldtype name="geohash" class="solr.GeoHashField"/>
418
+
419
+ <!--
420
+ A SpatialTileField is like a set of zoom levels on an interactive map (i.e. Google Maps or MapQuest). It takes a lat/lon
421
+ field and indexes it into (end - start) different fields, each representing a different zoom level.
422
+ This can then be leveraged to quickly narrow the search space by creating a filter, at an appropriate tier level,
423
+ that only has to enumerate a minimum number of terms.
424
+
425
+ See http://wiki.apache.org/solr/SpatialSearch
426
+ -->
427
+ <fieldType name="tile" class="solr.SpatialTileField" start="4" end="15" subFieldSuffix="_tiled"/>
428
+
429
+ <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" >
430
+ <analyzer>
431
+ <tokenizer class="solr.StandardTokenizerFactory"/>
432
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
433
+ <filter class="solr.StandardFilterFactory"/>
434
+ <filter class="solr.LowerCaseFilterFactory"/>
435
+ <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
436
+ </analyzer>
437
+ </fieldType>
438
+
439
+ </types>
440
+
441
+
442
+ <fields>
443
+ <field name="id" type="string" indexed="true" stored="true" required="true" />
444
+ <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
445
+ <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
446
+ <field name="spell" type="textSpell" indexed="true" stored="true" multiValued="true"/>
447
+ <dynamicField name="*_i" type="sint" indexed="true" stored="true"/>
448
+ <dynamicField name="*_s" type="string" indexed="true" stored="true" multiValued="true"/>
449
+ <dynamicField name="*_l" type="slong" indexed="true" stored="true"/>
450
+ <dynamicField name="*_t" type="text" indexed="true" stored="true" multiValued="true"/>
451
+ <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
452
+ <dynamicField name="*_f" type="sfloat" indexed="true" stored="true"/>
453
+ <dynamicField name="*_d" type="sdouble" indexed="true" stored="true"/>
454
+ <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
455
+ <dynamicField name="random*" type="random" />
456
+ <dynamicField name="*_facet" type="string" indexed="true" stored="true" multiValued="true" />
457
+ <dynamicField name="*_display" type="string" indexed="false" stored="true" />
458
+ </fields>
459
+
460
+
461
+ <uniqueKey>id</uniqueKey>
462
+ <defaultSearchField>text</defaultSearchField>
463
+ <solrQueryParser defaultOperator="OR"/>
464
+ <copyField source="*_facet" dest="text"/>
465
+
466
+
467
+
468
+ </schema>