Skip to content

Commit 5abe337

Browse files
committed
Merge pull request uselagoon#807 from amazeeio/solr-7.5
Solr 7.5 support
2 parents 82a2dc1 + 328ac31 commit 5abe337

16 files changed

+2437
-2
lines changed

Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ build/php__7.3-cli-drupal: build/php__7.3-cli
234234

235235
solrimages := solr__5.5 \
236236
solr__6.6 \
237+
solr__7.5 \
237238
solr__5.5-drupal \
238-
solr__6.6-drupal
239+
solr__6.6-drupal \
240+
solr__7.5-drupal
239241

240242

241243
build-solrimages = $(foreach image,$(solrimages),build/$(image))
@@ -255,9 +257,10 @@ $(build-solrimages): build/commons
255257
base-images += $(solrimages)
256258
s3-images += solr
257259

258-
build/solr__5.5 build/solr__6.6: images/commons
260+
build/solr__5.5 build/solr__6.6 build/solr__7.5: images/commons
259261
build/solr__5.5-drupal: build/solr__5.5
260262
build/solr__6.6-drupal: build/solr__6.6
263+
build/solr__7.5-drupal: build/solr__7.5
261264

262265
#######
263266
####### Node Images
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
3+
<!--
4+
This file allows you to boost certain search items to the top of search
5+
results. You can find out an item's ID by searching directly on the Solr
6+
server. Search API generally constructs item IDs (esp. for entities) as:
7+
$document->id = "$site_hash-$index_id-$datasource:$entity_id:$language_id";
8+
9+
If you want this file to be automatically re-loaded when a Solr commit takes
10+
place (e.g., if you have an automatic script active which updates elevate.xml
11+
according to newly-indexed data), place it into Solr's data/ directory.
12+
Otherwise, place it with the other configuration files into the conf/
13+
directory.
14+
15+
See http://wiki.apache.org/solr/QueryElevationComponent for more information.
16+
-->
17+
18+
<elevate>
19+
<!-- Example for ranking the node #789 first in searches for "example query": -->
20+
<!--
21+
<query text="example query">
22+
<doc id="ab12cd34-site_index-entity:789:en" />
23+
</query>
24+
-->
25+
<!-- Multiple <query> elements can be specified, contained in one <elevate>. -->
26+
<!-- <query text="...">...</query> -->
27+
</elevate>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file contains character mappings for the default fulltext field type.
2+
# The source characters (on the left) will be replaced by the respective target
3+
# characters before any other processing takes place.
4+
# Lines starting with a pound character # are ignored.
5+
#
6+
# For sensible defaults, use the mapping-ISOLatin1Accent.txt file distributed
7+
# with the example application of your Solr version.
8+
#
9+
# Examples:
10+
# "À" => "A"
11+
# "\u00c4" => "A"
12+
# "\u00c4" => "\u0041"
13+
# "æ" => "ae"
14+
# "\n" => " "
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#-----------------------------------------------------------------------
2+
# This file blocks words from being operated on by the stemmer and word delimiter.
3+
&amp;
4+
&lt;
5+
&gt;
6+
&#039;
7+
&quot;

images/solr-drupal/solr7.5/conf/schema.xml

+696
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!--
2+
The config generator will add dynamic fields here automatically as required by
3+
your individual drupal setup.
4+
5+
Since search_api_solr 8.x-2.0 it's required to use dynamically generated
6+
config files instead copying them.
7+
8+
Having these fields in a separate file is better than modifying schema.xml.
9+
-->
10+
Don't use the config XML templates directly. Use the config generator to get
11+
your individual config files. Use the "Get config.zip" button in the UI or
12+
drush solr-gsc my_solr_server
13+
See INSTALL.md for details.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!--
2+
The config generator will add more field types here automatically if
3+
required by your drupal setup. Having these field types in a separate file is
4+
better than modifying schema.xml.
5+
-->
6+
7+
<!-- An unstemmed text field - good if one does not know the language of the field -->
8+
<fieldType name="text_und" class="solr.TextField" positionIncrementGap="100">
9+
<analyzer type="index">
10+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
11+
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
12+
<filter class="solr.WordDelimiterGraphFilterFactory"
13+
protected="protwords.txt"
14+
generateWordParts="1"
15+
generateNumberParts="1"
16+
catenateWords="1"
17+
catenateNumbers="1"
18+
catenateAll="0"
19+
splitOnCaseChange="0"/>
20+
<filter class="solr.LengthFilterFactory" min="2" max="100" />
21+
<filter class="solr.LowerCaseFilterFactory"/>
22+
</analyzer>
23+
<analyzer type="query">
24+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
25+
<filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
26+
<filter class="solr.StopFilterFactory"
27+
ignoreCase="true"
28+
words="stopwords.txt"
29+
/>
30+
<filter class="solr.WordDelimiterGraphFilterFactory"
31+
protected="protwords.txt"
32+
generateWordParts="1"
33+
generateNumberParts="1"
34+
catenateWords="0"
35+
catenateNumbers="0"
36+
catenateAll="0"
37+
splitOnCaseChange="0"/>
38+
<filter class="solr.LengthFilterFactory" min="2" max="100" />
39+
<filter class="solr.LowerCaseFilterFactory"/>
40+
</analyzer>
41+
<analyzer type="multiterm">
42+
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
43+
<filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
44+
<filter class="solr.StopFilterFactory"
45+
ignoreCase="true"
46+
words="stopwords.txt"
47+
/>
48+
<filter class="solr.WordDelimiterGraphFilterFactory"
49+
protected="protwords.txt"
50+
generateWordParts="1"
51+
generateNumberParts="1"
52+
catenateWords="0"
53+
catenateNumbers="0"
54+
catenateAll="0"
55+
splitOnCaseChange="0"/>
56+
<filter class="solr.LengthFilterFactory" min="2" max="100" />
57+
<filter class="solr.LowerCaseFilterFactory"/>
58+
</analyzer>
59+
</fieldType>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!-- Search Api specific fields -->
2+
<!-- item_id contains the entity ID, e.g. a node's nid. -->
3+
<field name="item_id" type="string" indexed="true" stored="true" />
4+
5+
<!-- Apache Solr Search Integration specific fields -->
6+
<!-- entity_id is the numeric object ID, e.g. Node ID, File ID -->
7+
<field name="entity_id" type="long" indexed="true" stored="true" />
8+
<!-- entity_type is 'node', 'file', 'user', or some other Drupal object type -->
9+
<field name="entity_type" type="string" indexed="true" stored="true" />
10+
<!-- bundle is a node type, or as appropriate for other entity types -->
11+
<field name="bundle" type="string" indexed="true" stored="true"/>
12+
<field name="bundle_name" type="string" indexed="true" stored="true"/>
13+
<field name="url" type="string" indexed="true" stored="true"/>
14+
<!-- label is the default field for a human-readable string for this entity (e.g. the title of a node) -->
15+
<field name="label" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true"/>
16+
17+
<!-- content is the default field for full text search - dump crap here -->
18+
<field name="content" type="text" indexed="true" stored="true" termVectors="true"/>
19+
<field name="teaser" type="text" indexed="false" stored="true"/>
20+
<field name="path" type="string" indexed="true" stored="true"/>
21+
<field name="path_alias" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true"/>
22+
23+
<!-- These are the fields that correspond to a Drupal node. The beauty of having
24+
Lucene store title, body, type, etc., is that we retrieve them with the search
25+
result set and don't need to go to the database with a node_load. -->
26+
<field name="tid" type="long" indexed="true" stored="true" multiValued="true"/>
27+
<field name="taxonomy_names" type="text" indexed="true" stored="false" termVectors="true" multiValued="true" omitNorms="true"/>
28+
<!-- copyField commands copy one field to another at the time a document
29+
is added to the index. It's used either to index the same field differently,
30+
or to add multiple fields to the same field for easier/faster searching. -->
31+
<!-- Since sorting by ID is explicitly allowed, store item_id also in a sortable way. -->
32+
<copyField source="item_id" dest="sort_search_api_id" />
33+
34+
<!-- The string version of the title is used for sorting -->
35+
<copyField source="label" dest="sort_label"/>
36+
37+
<!-- Copy terms to a single field that contains all taxonomy term names -->
38+
<copyField source="tm_vid_*" dest="taxonomy_names"/>
39+
40+
<copyField source="label" dest="spell"/>
41+
<copyField source="content" dest="spell"/>
42+
43+
<copyField source="ss_*" dest="sort_*"/>
44+
45+
<dynamicField name="hss_*" type="sint" indexed="true" stored="true" multiValued="false"/>
46+
<dynamicField name="hsm_*" type="sint" indexed="true" stored="true" multiValued="true"/>
47+
<!-- Sortable fields, good for sortMissingLast support &
48+
We use long for integer since 64 bit ints are now common in PHP. -->
49+
<dynamicField name="iss_*" type="slong" indexed="true" stored="true" multiValued="false"/>
50+
<dynamicField name="ism_*" type="slong" indexed="true" stored="true" multiValued="true"/>
51+
<!-- In rare cases a sfloat rather than tfloat is needed for sortMissingLast -->
52+
<dynamicField name="fss_*" type="sfloat" indexed="true" stored="true" multiValued="false"/>
53+
<dynamicField name="fsm_*" type="sfloat" indexed="true" stored="true" multiValued="true"/>
54+
<dynamicField name="pss_*" type="sdouble" indexed="true" stored="true" multiValued="false"/>
55+
<dynamicField name="psm_*" type="sdouble" indexed="true" stored="true" multiValued="true"/>
56+
57+
<!--
58+
A set of fields to contain text extracted from HTML tag contents which we
59+
can boost at query time.
60+
-->
61+
<dynamicField name="tags_*" type="text" indexed="true" stored="false" omitNorms="true"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!--
2+
Note:
3+
These should only be used for compatibility with existing indexes (created with older Solr versions)
4+
or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
5+
6+
Numeric field types that manipulate the value into
7+
a string value that isn't human-readable in its internal form,
8+
but with a lexicographic ordering the same as the numeric ordering,
9+
so that range queries work correctly.
10+
-->
11+
<fieldType name="sint" class="solr.TrieIntField" sortMissingLast="true"/>
12+
<fieldType name="sfloat" class="solr.TrieFloatField" sortMissingLast="true"/>
13+
<fieldType name="slong" class="solr.TrieLongField" sortMissingLast="true"/>
14+
<fieldType name="sdouble" class="solr.TrieDoubleField" sortMissingLast="true"/>

0 commit comments

Comments
 (0)