Skip to content

Commit

Permalink
CHEF-2553: Extract packed solr material. Pack it at rake gem/package …
Browse files Browse the repository at this point in the history
…time

instead. This effectively breaks gem build for chef-solr.gemspec as it won't
produce a complete package.
  • Loading branch information
mdkent committed Aug 17, 2011
1 parent 61092a4 commit 4efe003
Show file tree
Hide file tree
Showing 23 changed files with 1,507 additions and 6 deletions.
1 change: 1 addition & 0 deletions chef-solr/.gitignore
Expand Up @@ -7,3 +7,4 @@ solr/work
solr/solr/data/*
solr/logs
solr/clustering
solr/*.tar.gz
12 changes: 11 additions & 1 deletion chef-solr/Rakefile
Expand Up @@ -24,7 +24,17 @@ require 'rake/gempackagetask'

GEM_NAME = "chef-solr"

spec = eval(File.read("chef-solr.gemspec"))
spec = eval(File.read(File.dirname(__FILE__) + "/chef-solr.gemspec"))

desc "Create solr archives"
task :tar_solr do
%w{solr-home solr-jetty}.each do |tar|
Dir.chdir(File.dirname(__FILE__) + "/solr/#{tar}") { sh "tar cvzf ../#{tar}.tar.gz *" }
spec.files += [ "solr/#{tar}.tar.gz" ]
end
end

task :gem => :tar_solr

Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
Expand Down
9 changes: 4 additions & 5 deletions chef-solr/chef-solr.gemspec
@@ -1,3 +1,6 @@
# WARNING: Archives are created during the build process, please use 'rake gem'
# or 'rake package' to build this gem rather than 'gem build'.

require File.dirname(__FILE__) + '/lib/chef/solr/version'

Gem::Specification.new do |gem|
Expand All @@ -10,9 +13,5 @@ Gem::Specification.new do |gem|
gem.add_dependency "chef", Chef::Solr::VERSION
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
gem.executables = [ 'chef-solr', 'chef-solr-installer', 'chef-solr-rebuild' ]
gem.files = [
"README.rdoc",
"Rakefile"
]
gem.files = %w{ README.rdoc Rakefile LICENSE} + Dir.glob("{bin,lib,solr,spec}/**/*")
gem.files = %w{ README.rdoc Rakefile LICENSE} + Dir.glob("{bin,lib,spec}/**/*")
end
Binary file removed chef-solr/solr/solr-home.tar.gz
Binary file not shown.
31 changes: 31 additions & 0 deletions chef-solr/solr/solr-home/conf/admin-extra.html
@@ -0,0 +1,31 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
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
http://www.apache.org/licenses/LICENSE-2.0
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.
-->

<!-- The content of this page will be statically included into the top
of the admin page. Uncomment this as an example to see there the content
will show up.
<hr>
<i>This line will appear before the first table</i>
<tr>
<td colspan="2">
This row will be appended to the end of the first table
</td>
</tr>
<hr>
-->
195 changes: 195 additions & 0 deletions chef-solr/solr/solr-home/conf/schema.xml
@@ -0,0 +1,195 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
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
http://www.apache.org/licenses/LICENSE-2.0
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.
-->

<!--
This is the Solr schema file. This file should be named "schema.xml" and
should be in the conf directory under the solr home
(i.e. ./solr/conf/schema.xml by default)
or located where the classloader for the Solr webapp can find it.
This example schema is the recommended starting point for users.
It should be kept correct and concise, usable out-of-the-box.
For more information, on how to customize this file, please see
http://wiki.apache.org/solr/SchemaXml
NOTE: this schema includes many optional features and should not
be used for benchmarking.
-->

<schema name="chef" version="1.2">
<!-- attribute "name" is the name of this schema and is only used for display purposes.
Applications should change this to reflect the nature of the search collection.
version="1.2" is Solr's version number for the schema syntax and semantics. It should
not normally be changed by applications.
1.0: multiValued attribute did not exist, all fields are multiValued by nature
1.1: multiValued attribute introduced, false by default
1.2: omitTermFreqAndPositions attribute introduced, true by default except for text fields.
-->

<types>
<!-- field type definitions. The "name" attribute is
just a label to be used by field definitions. The "class"
attribute and any other attributes determine the real
behavior of the fieldType.
Class names starting with "solr" refer to java classes in the
org.apache.solr.analysis package.
-->

<!-- The StrField type is not analyzed, but indexed/stored verbatim.
- StrField and TextField support an optional compressThreshold which
limits compression (if enabled in the derived fields) to values which
exceed a certain size (in characters).
-->
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>

<!-- boolean type: "true" or "false" -->
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>

<!-- The optional sortMissingLast and sortMissingFirst attributes are
currently supported on types that are sorted internally as strings.
- If sortMissingLast="true", then a sort on this field will cause documents
without the field to come after documents with the field,
regardless of the requested sort order (asc or desc).
- If sortMissingFirst="true", then a sort on this field will cause documents
without the field to come before documents with the field,
regardless of the requested sort order.
- If sortMissingLast="false" and sortMissingFirst="false" (the default),
then default lucene sorting will be used which places docs without the
field first in an ascending sort and last in a descending sort.
-->


<!-- numeric field types that store and index the text
value verbatim (and hence don't support range queries, since the
lexicographic ordering isn't equal to the numeric ordering) -->
<fieldType name="integer" class="solr.IntField" omitNorms="true"/>
<fieldType name="long" class="solr.LongField" omitNorms="true"/>
<fieldType name="float" class="solr.FloatField" omitNorms="true"/>
<fieldType name="double" class="solr.DoubleField" omitNorms="true"/>


<!-- Numeric field types that manipulate the value into
a string value that isn't human-readable in its internal form,
but with a lexicographic ordering the same as the numeric ordering,
so that range queries work correctly. -->
<fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>


<fieldtype name="stuff" class="solr.TextField" omitNorms="true">
<analyzer class="org.apache.lucene.analysis.WhitespaceAnalyzer"/>
</fieldtype>

<!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
is a more restricted form of the canonical representation of dateTime
http://www.w3.org/TR/xmlschema-2/#dateTime
The trailing "Z" designates UTC time and is mandatory.
Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
All other components are mandatory.
Expressions can also be used to denote calculations that should be
performed relative to "NOW" to determine the value, ie...
NOW/HOUR
... Round to the start of the current hour
NOW-1DAY
... Exactly 1 day prior to now
NOW/DAY+6MONTHS+3DAYS
... 6 months and 3 days in the future from the start of
the current day
Consult the DateField javadocs for more information.
-->
<fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>

</types>

<fields>
<!-- Valid attributes for fields:
name: mandatory - the name for the field
type: mandatory - the name of a previously defined type from the <types> section
indexed: true if this field should be indexed (searchable or sortable)
stored: true if this field should be retrievable
compressed: [false] if this field should be stored using gzip compression
(this will only apply if the field type is compressable; among
the standard field types, only TextField and StrField are)
multiValued: true if this field may contain multiple values per document
omitNorms: (expert) set to true to omit the norms associated with
this field (this disables length normalization and index-time
boosting for the field, and saves some memory). Only full-text
fields or fields that need an index-time boost need norms.
termVectors: [false] set to true to store the term vector for a given field.
When using MoreLikeThis, fields used for similarity should be stored for
best performance.
termPositions: Store position information with the term vector. This will increase storage costs.
termOffsets: Store offset information with the term vector. This will increase storage costs.
-->

<field name="X_CHEF_id_CHEF_X" type="string" indexed="true" stored="true" required="true" />
<field name="X_CHEF_database_CHEF_X" type="string" indexed="true" stored="true" required="true" />
<field name="X_CHEF_type_CHEF_X" type="string" indexed="true" stored="true" required="true" />
<field name="X_CHEF_timestamp_CHEF_X" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>

<field name="content" type="stuff" indexed="true" stored="false" required="false"
multiValued="true" termPositions="false" termOffsets="false" />

<!-- Dynamic field definitions. If a field name is not found, dynamicFields
will be used if the name matches any of the patterns.
RESTRICTION: the glob-like pattern in the name attribute must have
a "*" only at the start or the end.
EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
Longer patterns will be matched first. if equal size patterns
both match, the first appearing in the schema will be used. -->
<dynamicField name="*_i" type="sint" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*_s" type="string" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*_l" type="slong" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*_t" type="string" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*_b" type="boolean" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*_f" type="sfloat" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*_d" type="sdouble" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*_dt" type="date" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*" type="string" indexed="true" stored="false" multiValued="true"/>

<!-- uncomment the following to ignore any fields that don't already match an existing
field name or dynamic field, rather than reporting them as an error.
alternately, change the type="ignored" to some other type e.g. "text" if you want
unknown fields indexed and/or stored by default -->
<!--dynamicField name="*" type="ignored" multiValued="true" /-->


</fields>


<!-- Field to use to determine and enforce document uniqueness.
Unless this field is marked with required="false", it will be a required field
-->
<uniqueKey>X_CHEF_id_CHEF_X</uniqueKey>

<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>content</defaultSearchField>

<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="OR"/>

<!-- Everything gets jammed into a basic text search field -->
<!-- <copyField source="*" dest="text"/> -->

</schema>
24 changes: 24 additions & 0 deletions chef-solr/solr/solr-home/conf/scripts.conf
@@ -0,0 +1,24 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.

user=
solr_hostname=localhost
solr_port=8983
rsyncd_port=18983
data_dir=
webapp_name=solr
master_host=
master_data_dir=
master_status_dir=

0 comments on commit 4efe003

Please sign in to comment.