# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# TODO: distill common shell script needs into common file for parsing parameters for Solr URL, input filename, -debug, etc
# script/runner or script/console-like, from Rails. A data mapper would be a great generalizable piece.
require 'solr'
if dl_filename == nil
puts "You must pass a filename as an option."
exit
end
# Exported column names
# medium,associatedURL,boxHeightInInches,boxLengthInInches,boxWeightInPounds,boxWidthInInches,
# scannednumber,upc,asin,country,title,fullTitle,series,numberInSeries,edition,aspect,mediacount,
# genre,price,currentValue,language,netrating,description,owner,publisher,published,rare,purchaseDate,rating,
# used,signed,hasExperienced,notes,location,paid,condition,notowned,author,illustrator,pages
mapping = {
:medium_facet => :medium,
:country_facet => :country,
:signed_facet => :signed,
:rating_facet => :netrating,
:language_facet => :language,
:title_text => :title,
:full_title_text => :fullTitle,
:asin_display => :asin,
:notes_text => :notes,
:publisher_facet => :publisher,
:description_text => :description,
:author_text => :author,
:pages_text => :pages,
}
# can modify solr_document before it is indexed here
end