Setup
- Solr version:8.6
- Drupal Core version: 10.1
- Search API version: 8.x-1.31
- Search API Solr version: 4.31
- Configured Solr Connector: Standard
Issue
Im trying to use EdgeNGramFilterFactory with the preserveOriginal option, which works fine should I manually include preserveOriginal="true" in my schema_extra_types.xml, however the issue is that when I try and get this into Drupal config, the "true" is being converted to "1".
class: solr.EdgeNGramFilterFactory
preserveOriginal: 1
minGramSize: 4
maxGramSize: 25
-So the next time the config set is pulled down the required "true" will now be "1" and this option ceases to function properly (IE, in the above example a string with 3 letters is ignored). Id have thought 1/true would be considered the same, but that doesn't seem to be the case in my testing.
1 = doesn't work as expected
true = does work as expected
Im going to get around this by hooking into the event that builds the config set, and manually overriding it but that feels pretty nasty.
Am I doing something wrong?
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3415609.patch | 3.21 KB | redwan jamous |
Issue fork search_api_solr-3415609
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
aaron.ferris commentedComment #3
aaron.ferris commentedComment #4
mkalkbrennerI wonder if we have a bug in our config schema.
Comment #5
aaron.ferris commentedYes possibly, seems like something similar has been seen before but with
ASCIIFoldingFilterComment #6
mkalkbrennerYes, it seems like an inconsistency of Solr. Fixing that todo will solve the issue for EdgeNGramFilterFactory, too.
Comment #7
mkalkbrennerI guess it will affect NGramFilterFactory as well.
What we basically need to do is:
Comment #10
redwan jamous commentedI created a MR that changes the value of
preserveOriginalto boolean for the following filters:solr.ASCIIFoldingFilterFactorysolr.EdgeNGramFilterFactorysolr.NGramFilterFactoryThis MR is just a starting point, I would appreciate any comments or further guidance.
Attaching a static patch file to use with composer...
Comment #11
sujal kshatri commented.
Comment #12
mkalkbrenner