You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by eh...@apache.org on 2007/02/04 10:39:55 UTC
svn commit: r503377 - in
/lucene/solr/trunk/client/ruby/solrb/examples/delicious_library:
conf/schema.xml dl_importer.rb
Author: ehatcher
Date: Sun Feb 4 01:39:55 2007
New Revision: 503377
URL: http://svn.apache.org/viewvc?view=rev&rev=503377
Log:
Added author and page count to import. Adjusted schema to not stem or remove stop words.
Modified:
lucene/solr/trunk/client/ruby/solrb/examples/delicious_library/conf/schema.xml
lucene/solr/trunk/client/ruby/solrb/examples/delicious_library/dl_importer.rb
Modified: lucene/solr/trunk/client/ruby/solrb/examples/delicious_library/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/ruby/solrb/examples/delicious_library/conf/schema.xml?view=diff&rev=503377&r1=503376&r2=503377
==============================================================================
--- lucene/solr/trunk/client/ruby/solrb/examples/delicious_library/conf/schema.xml (original)
+++ lucene/solr/trunk/client/ruby/solrb/examples/delicious_library/conf/schema.xml Sun Feb 4 01:39:55 2007
@@ -146,19 +146,19 @@
<!-- in this example, we will only use synonyms at query time
<filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
-->
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
+ <!-- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> -->
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
+ <!-- <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/> -->
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
+ <!-- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> -->
+ <!-- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/> -->
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
+ <!-- <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/> -->
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
</fieldtype>
Modified: lucene/solr/trunk/client/ruby/solrb/examples/delicious_library/dl_importer.rb
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/ruby/solrb/examples/delicious_library/dl_importer.rb?view=diff&rev=503377&r1=503376&r2=503377
==============================================================================
--- lucene/solr/trunk/client/ruby/solrb/examples/delicious_library/dl_importer.rb (original)
+++ lucene/solr/trunk/client/ruby/solrb/examples/delicious_library/dl_importer.rb Sun Feb 4 01:39:55 2007
@@ -1,3 +1,4 @@
+#!/usr/bin/env ruby
# 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
@@ -22,7 +23,7 @@
solr = Solr::Connection.new(solr_url)
lines = IO.readlines(dl_filename)
-headers = lines[0].split("\t")
+headers = lines[0].split("\t").collect{|h| h.chomp}
puts headers.join(','),"-----" if debug
# Exported column names
@@ -41,11 +42,13 @@
:title_text => :title,
:notes_text => :notes,
:publisher_text => :publisher,
- :description_text => :description
+ :description_text => :description,
+ :author_text => :author,
+ :pages_text => :pages
}
lines[1..-1].each do |line|
- data = headers.zip(line.split("\t"))
+ data = headers.zip(line.split("\t").collect{|s| s.chomp})
def data.method_missing(key)
self.assoc(key.to_s)[1]
end
@@ -60,6 +63,7 @@
doc[solr_name] = value if value
end
+ puts data.title
puts doc.inspect if debug
solr.add doc unless debug