For example, the 'ignoreCase' argument expects a value "true" rather than "1" in exported schema_extra_types.xml, because the value "1" will be parsed to value false in java: https://github.com/apache/lucene-solr/blob/master/lucene/analysis/common...

<filter class="solr.StopFilterFactory" ignoreCase="1" words="stopwords_en.txt"/>

should be:

<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt"/>

The same to 'onlyLongestMatch', 'expand' and 'concat' arguments.

CommentFileSizeAuthor
#2 2933293-2.patch52.2 KBedaa

Comments

edwardaa created an issue. See original summary.

edaa’s picture

StatusFileSize
new52.2 KB

Add a patch

edaa’s picture

Status: Active » Needs review

The major changes in above patch:

diff --git a/config/schema/solr_field_type.schema.yml b/config/schema/solr_field_type.schema.yml
index 341b7cb..f54726c 100644
--- a/config/schema/solr_field_type.schema.yml
+++ b/config/schema/solr_field_type.schema.yml
@@ -141,11 +141,11 @@ search_api_solr.solr_field_type.*:
                       label: 'DictionaryCompoundWordTokenFilter::maxSubwordSize'
                       nullable: true
                     onlyLongestMatch:
-                      type: boolean
+                      type: string
                       label: 'DictionaryCompoundWordTokenFilter::onlyLongestMatch'
                       nullable: true
                     ignoreCase:
-                      type: boolean
+                      type: string
                       label: 'StopFilter:: SynonymFilter::ignoreCase'
                       nullable: true
                     words:
@@ -161,7 +161,7 @@ search_api_solr.solr_field_type.*:
                       label: 'SynonymFilter::synonyms'
                       nullable: true
                     expand:
-                      type: boolean
+                      type: string
                       label: 'SynonymFilter:: ManagedSynonymFilter::expand'
                       nullable: true
                     managed:
@@ -193,7 +193,7 @@ search_api_solr.solr_field_type.*:
                       label: 'BeiderMorseFilter::ruleType'
                       nullable: true
                     concat:
-                      type: boolean
+                      type: string
                       label: 'BeiderMorseFilter::concat'
                       nullable: true
mkalkbrenner’s picture

Status: Needs review » Needs work

Thanks for pointing that out!

But the proposed fix is wrong, because we'll lose drupal's schema verification since a string can be anything.

We already have code at various places that coverts drupal booleans to strings. It seems that we missed that when creating the Solr XML config files.

Examples, where the convertion already happens:
SearchApiSolrBackend::formatFilterValue()
SolrFieldTypeListBuilder::getSchemaExtraFieldsXml()

I think we should adjust SolrFieldType::buildXmlFromArray() accordingly.

edaa’s picture

Status: Needs work » Closed (works as designed)

Thanks, I didn't notice the convertion already happens. So closed it.

mkalkbrenner’s picture

Status: Closed (works as designed) » Active

I re-open it as a reminder that I have to check all the places. I'm not sure that we covered all places.

mkalkbrenner’s picture

Component: &amp;quot;Any Schema&amp;quot; backend » Code
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.