mirror of https://github.com/apache/lucene.git
Add full title text, asin and published year, as well as moved publisher to facet
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@508292 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4a33261c27
commit
7f130dd630
|
@ -40,11 +40,14 @@ mapping = {
|
||||||
:language_facet => :language,
|
:language_facet => :language,
|
||||||
:genre_facet => Proc.new {|data| data.genre.split('/').map {|s| s.strip}},
|
:genre_facet => Proc.new {|data| data.genre.split('/').map {|s| s.strip}},
|
||||||
:title_text => :title,
|
: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,
|
:notes_text => :notes,
|
||||||
:publisher_text => :publisher,
|
:publisher_facet => :publisher,
|
||||||
:description_text => :description,
|
:description_text => :description,
|
||||||
:author_text => :author,
|
: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|
|
lines[1..-1].each do |line|
|
||||||
|
@ -53,6 +56,8 @@ lines[1..-1].each do |line|
|
||||||
self.assoc(key.to_s)[1]
|
self.assoc(key.to_s)[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# puts data.inspect if debug
|
||||||
|
|
||||||
doc = {}
|
doc = {}
|
||||||
mapping.each do |solr_name, data_column_or_proc|
|
mapping.each do |solr_name, data_column_or_proc|
|
||||||
if data_column_or_proc.is_a? Proc
|
if data_column_or_proc.is_a? Proc
|
||||||
|
@ -70,3 +75,4 @@ lines[1..-1].each do |line|
|
||||||
end
|
end
|
||||||
|
|
||||||
solr.commit unless debug
|
solr.commit unless debug
|
||||||
|
solr.optimize unless debug
|
Loading…
Reference in New Issue