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,
|
||||
: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
|
Loading…
Reference in New Issue