[MGNLEESOLR-111] Multivalue JCR fields saved to Multivalue field in SOLR as String Created: 28/Apr/17  Updated: 02/Mar/23

Status: Open
Project: Solr Search Provider
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: Mariusz Chruscielewski Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
duplicate
is duplicated by MGNLEESOLR-89 Multi value field indexing Closed
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Visible to:
Federico Navarro
Epic Link: Solr support issues
Team: Nucleus

 Description   

Hi, in my opinion, saving multivalue fields (JCR) to SOLR as String (separated by comma) is very not correct.

If in SOLR schema field is configured as multivalue, it should be saved as array, but Magnolia
info.magnolia.search.solrsearchprovider.logic.indexer.SolrIndexerImpl class expects all "things" to be String (Map<String,String> things).

Because of that info.magnolia.search.solrsearchprovider.logic.indexer.BasicSolrIndexService turns String[] into String:

else if(o instanceof String[])

{ value = StringUtils.join((String[])((String[])o), ", "); }

Because of that value is stored in solr like:

"articleOldUrls": [
"text, another, yet-another"
]

instead of:

"articleOldUrls": [
"text",
"another",
"yet-another"
]

That makes solr search unusable, I can't do query:

http://localhost:8983/solr/vinl_collection/select?q=articleOldUrls%3Ayet-another&wt=json&indent=true

because it won't return any results.

When I did some hacking, and passed String[] array to SolrInputDocument and then I saved it using standard magnoliaSolrBrigde, it works fine.

I think this should be fixed.

Regards
Mariusz


Generated at Mon Feb 12 11:00:13 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.