Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Add full title text, asin and published year, as well as moved publisher to facet

Erik Hatcher7f130dd630e9
diff --git a/client/ruby/solrb/examples/delicious_library/dl_importer.rb b/client/ruby/solrb/examples/delicious_library/dl_importer.rb
index 1978c480543..e7aeffb700a 100755
--- a/client/ruby/solrb/examples/delicious_library/dl_importer.rb
+++ b/client/ruby/solrb/examples/delicious_library/dl_importer.rb
@@ -40,11 +40,14 @@ mapping = {
:language_facet => :language,
:genre_facet => Proc.new {|data| data.genre.split('/').map {|s| s.strip}},
:title_text => :title,
+ :full_title_text => :fullTitle,
+ :asin_text => :asin, # TODO: schema needs a field for non-tokenized text which is not a facet
:notes_text => :notes,
- :publisher_text => :publisher,
+ :publisher_facet => :publisher,
:description_text => :description,
:author_text => :author,
- :pages_text => :pages
+ :pages_text => :pages,
+ :published_year_facet => Proc.new {|data| data.published.scan(/\d\d\d\d/)[0]}
}
lines[1..-1].each do |line|
@@ -52,6 +55,8 @@ lines[1..-1].each do |line|
def data.method_missing(key)
self.assoc(key.to_s)[1]
end
+
+ # puts data.inspect if debug
doc = {}
mapping.each do |solr_name, data_column_or_proc|
@@ -70,3 +75,4 @@ lines[1..-1].each do |line|
end
solr.commit unless debug
+solr.optimize unless debug
\ No newline at end of file