Skip to content

Commit

Permalink
Merge pull request #807 from amazeeio/solr-7.5
Browse files Browse the repository at this point in the history
Solr 7.5 support
  • Loading branch information
Schnitzel committed Dec 31, 2018
2 parents 82a2dc1 + 328ac31 commit 5abe337
Show file tree
Hide file tree
Showing 16 changed files with 2,437 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ build/php__7.3-cli-drupal: build/php__7.3-cli

solrimages := solr__5.5 \
solr__6.6 \
solr__7.5 \
solr__5.5-drupal \
solr__6.6-drupal
solr__6.6-drupal \
solr__7.5-drupal


build-solrimages = $(foreach image,$(solrimages),build/$(image))
Expand All @@ -255,9 +257,10 @@ $(build-solrimages): build/commons
base-images += $(solrimages)
s3-images += solr

build/solr__5.5 build/solr__6.6: images/commons
build/solr__5.5 build/solr__6.6 build/solr__7.5: images/commons
build/solr__5.5-drupal: build/solr__5.5
build/solr__6.6-drupal: build/solr__6.6
build/solr__7.5-drupal: build/solr__7.5

#######
####### Node Images
Expand Down
27 changes: 27 additions & 0 deletions images/solr-drupal/solr7.5/conf/elevate.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!--
This file allows you to boost certain search items to the top of search
results. You can find out an item's ID by searching directly on the Solr
server. Search API generally constructs item IDs (esp. for entities) as:
$document->id = "$site_hash-$index_id-$datasource:$entity_id:$language_id";
If you want this file to be automatically re-loaded when a Solr commit takes
place (e.g., if you have an automatic script active which updates elevate.xml
according to newly-indexed data), place it into Solr's data/ directory.
Otherwise, place it with the other configuration files into the conf/
directory.
See http://wiki.apache.org/solr/QueryElevationComponent for more information.
-->

<elevate>
<!-- Example for ranking the node #789 first in searches for "example query": -->
<!--
<query text="example query">
<doc id="ab12cd34-site_index-entity:789:en" />
</query>
-->
<!-- Multiple <query> elements can be specified, contained in one <elevate>. -->
<!-- <query text="...">...</query> -->
</elevate>
14 changes: 14 additions & 0 deletions images/solr-drupal/solr7.5/conf/mapping-ISOLatin1Accent.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file contains character mappings for the default fulltext field type.
# The source characters (on the left) will be replaced by the respective target
# characters before any other processing takes place.
# Lines starting with a pound character # are ignored.
#
# For sensible defaults, use the mapping-ISOLatin1Accent.txt file distributed
# with the example application of your Solr version.
#
# Examples:
# "À" => "A"
# "\u00c4" => "A"
# "\u00c4" => "\u0041"
# "æ" => "ae"
# "\n" => " "
7 changes: 7 additions & 0 deletions images/solr-drupal/solr7.5/conf/protwords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#-----------------------------------------------------------------------
# This file blocks words from being operated on by the stemmer and word delimiter.
&amp;
&lt;
&gt;
&#039;
&quot;
696 changes: 696 additions & 0 deletions images/solr-drupal/solr7.5/conf/schema.xml

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions images/solr-drupal/solr7.5/conf/schema_extra_fields.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--
The config generator will add dynamic fields here automatically as required by
your individual drupal setup.
Since search_api_solr 8.x-2.0 it's required to use dynamically generated
config files instead copying them.
Having these fields in a separate file is better than modifying schema.xml.
-->
Don't use the config XML templates directly. Use the config generator to get
your individual config files. Use the "Get config.zip" button in the UI or
drush solr-gsc my_solr_server
See INSTALL.md for details.
59 changes: 59 additions & 0 deletions images/solr-drupal/solr7.5/conf/schema_extra_types.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!--
The config generator will add more field types here automatically if
required by your drupal setup. Having these field types in a separate file is
better than modifying schema.xml.
-->

<!-- An unstemmed text field - good if one does not know the language of the field -->
<fieldType name="text_und" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.WordDelimiterGraphFilterFactory"
protected="protwords.txt"
generateWordParts="1"
generateNumberParts="1"
catenateWords="1"
catenateNumbers="1"
catenateAll="0"
splitOnCaseChange="0"/>
<filter class="solr.LengthFilterFactory" min="2" max="100" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords.txt"
/>
<filter class="solr.WordDelimiterGraphFilterFactory"
protected="protwords.txt"
generateWordParts="1"
generateNumberParts="1"
catenateWords="0"
catenateNumbers="0"
catenateAll="0"
splitOnCaseChange="0"/>
<filter class="solr.LengthFilterFactory" min="2" max="100" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="multiterm">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords.txt"
/>
<filter class="solr.WordDelimiterGraphFilterFactory"
protected="protwords.txt"
generateWordParts="1"
generateNumberParts="1"
catenateWords="0"
catenateNumbers="0"
catenateAll="0"
splitOnCaseChange="0"/>
<filter class="solr.LengthFilterFactory" min="2" max="100" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
61 changes: 61 additions & 0 deletions images/solr-drupal/solr7.5/conf/schema_legacy_fields.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!-- Search Api specific fields -->
<!-- item_id contains the entity ID, e.g. a node's nid. -->
<field name="item_id" type="string" indexed="true" stored="true" />

<!-- Apache Solr Search Integration specific fields -->
<!-- entity_id is the numeric object ID, e.g. Node ID, File ID -->
<field name="entity_id" type="long" indexed="true" stored="true" />
<!-- entity_type is 'node', 'file', 'user', or some other Drupal object type -->
<field name="entity_type" type="string" indexed="true" stored="true" />
<!-- bundle is a node type, or as appropriate for other entity types -->
<field name="bundle" type="string" indexed="true" stored="true"/>
<field name="bundle_name" type="string" indexed="true" stored="true"/>
<field name="url" type="string" indexed="true" stored="true"/>
<!-- label is the default field for a human-readable string for this entity (e.g. the title of a node) -->
<field name="label" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true"/>

<!-- content is the default field for full text search - dump crap here -->
<field name="content" type="text" indexed="true" stored="true" termVectors="true"/>
<field name="teaser" type="text" indexed="false" stored="true"/>
<field name="path" type="string" indexed="true" stored="true"/>
<field name="path_alias" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true"/>

<!-- These are the fields that correspond to a Drupal node. The beauty of having
Lucene store title, body, type, etc., is that we retrieve them with the search
result set and don't need to go to the database with a node_load. -->
<field name="tid" type="long" indexed="true" stored="true" multiValued="true"/>
<field name="taxonomy_names" type="text" indexed="true" stored="false" termVectors="true" multiValued="true" omitNorms="true"/>
<!-- copyField commands copy one field to another at the time a document
is added to the index. It's used either to index the same field differently,
or to add multiple fields to the same field for easier/faster searching. -->
<!-- Since sorting by ID is explicitly allowed, store item_id also in a sortable way. -->
<copyField source="item_id" dest="sort_search_api_id" />

<!-- The string version of the title is used for sorting -->
<copyField source="label" dest="sort_label"/>

<!-- Copy terms to a single field that contains all taxonomy term names -->
<copyField source="tm_vid_*" dest="taxonomy_names"/>

<copyField source="label" dest="spell"/>
<copyField source="content" dest="spell"/>

<copyField source="ss_*" dest="sort_*"/>

<dynamicField name="hss_*" type="sint" indexed="true" stored="true" multiValued="false"/>
<dynamicField name="hsm_*" type="sint" indexed="true" stored="true" multiValued="true"/>
<!-- Sortable fields, good for sortMissingLast support &
We use long for integer since 64 bit ints are now common in PHP. -->
<dynamicField name="iss_*" type="slong" indexed="true" stored="true" multiValued="false"/>
<dynamicField name="ism_*" type="slong" indexed="true" stored="true" multiValued="true"/>
<!-- In rare cases a sfloat rather than tfloat is needed for sortMissingLast -->
<dynamicField name="fss_*" type="sfloat" indexed="true" stored="true" multiValued="false"/>
<dynamicField name="fsm_*" type="sfloat" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="pss_*" type="sdouble" indexed="true" stored="true" multiValued="false"/>
<dynamicField name="psm_*" type="sdouble" indexed="true" stored="true" multiValued="true"/>

<!--
A set of fields to contain text extracted from HTML tag contents which we
can boost at query time.
-->
<dynamicField name="tags_*" type="text" indexed="true" stored="false" omitNorms="true"/>
14 changes: 14 additions & 0 deletions images/solr-drupal/solr7.5/conf/schema_legacy_types.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--
Note:
These should only be used for compatibility with existing indexes (created with older Solr versions)
or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
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.TrieIntField" sortMissingLast="true"/>
<fieldType name="sfloat" class="solr.TrieFloatField" sortMissingLast="true"/>
<fieldType name="slong" class="solr.TrieLongField" sortMissingLast="true"/>
<fieldType name="sdouble" class="solr.TrieDoubleField" sortMissingLast="true"/>
Loading

0 comments on commit 5abe337

Please sign in to comment.