chriseldredge / Lucene.Net.Linq

LINQ provider to run native queries on a Lucene.Net index
Other
151 stars 65 forks source link

Null-safe string contains not converted correctly #48

Closed chriseldredge closed 10 years ago

chriseldredge commented 10 years ago

Original report: https://github.com/OctopusDeploy/Issues/issues/189 Also reported at: https://github.com/themotleyfool/NuGet.Lucene/issues/10

Queries that do String.Contains on a null safe expression are not converted correctly.

Example where clause:

docs.Where(d => (d.Name != null ? d.Name.ToLower() : "").Contains("foo"))
chriseldredge commented 10 years ago

Fixed in 0e7decbb223cb2c88aa52e8c687f5e08960291b3 by removing redundant null-safety expressions before translating Contains method call to a Lucene query expression.

chriseldredge commented 10 years ago

Released in build 55: https://www.nuget.org/packages/Lucene.Net.Linq/3.2.55