blipson89 / Synthesis

Synthesis is a universal object mapper for Sitecore
MIT License
75 stars 25 forks source link

Bugfix for solr field name translation #79

Closed mrambold closed 5 years ago

mrambold commented 5 years ago

While trying to use a LINQ query with GetSynthesisQueryable I noticed that the field name translation for solr was not working as intended: A query.Where(x => x.Title.RawValue.Contains("xyz")) was translated to the following solr query: title_t.rawvalue_t:(*xyz*) (RawValue was translated too). I solved this by wrapping the SynthesisSolrFieldNameTranslator in the regular SynthesisFieldNameTranslator, so the "normal" field name translation occurs also when using solr. I hope, this makes sense, but so far I had no issues with it.

blipson89 commented 5 years ago

Hi!

What version of Sitecore, Solr, and Synthesis are you using? This is the first time I'm hearing of this so I want to reproduce it first.

Thank you!

mrambold commented 5 years ago

Hi Ben

We are using Sitecore 9.1.0, Helix 9.1.0.1 and Solr 7.2.1. The models are generated with Leprechaun 1.0.1. Let me know, if you need more details or if I can help with reproducing the problem I had.

Thank you, Matthias

mrambold commented 5 years ago

Hi Ben

I'm closing the pull request, since my proposed fix didn't properly solve the issue. The queries were fine after my change, but there were new exceptions in the log when re-indexing the content, so I have to do some more testing. Sorry for all the fuss.

Regards, Matthias

blipson89 commented 5 years ago

hey @mrambold - I believe the latest (pre-release) version of Synthesis may solve this issue. I'd recommend trying that out to see if it resolves things.

mrambold commented 5 years ago

I just installed the pre-release nuget package (v9.1.0.2-beta1) and that solved all my problems. Thank you, you are awesome!