Skip to content

Commit b6209a0

Browse files
magnaremMagnar Eivind Martinsen
andauthored
Added quotes to equality queries to avoid solr that solr fail if the value contains solr specific characters (#136)
Co-authored-by: Magnar Eivind Martinsen <magnar.eivind.martinsen@met.no>
1 parent 53407d3 commit b6209a0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pygeofilter/backends/solr/evaluate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,10 @@ def equality(self, node, lhs, rhs):
307307
"""
308308
if node.op == ast.ComparisonOp.EQ:
309309
# Use a term query for equality
310-
return SolrDSLQuery(f"{lhs}:{rhs}")
310+
return SolrDSLQuery(f"{lhs}:\"{rhs}\"")
311311
elif node.op == ast.ComparisonOp.NE:
312312
# Use a boolean must_not query for inequality
313-
return SolrDSLQuery(f"-{lhs}:{rhs}")
313+
return SolrDSLQuery(f"-{lhs}:\"{rhs}\"")
314314

315315
@handle(ast.TemporalPredicate, subclasses=True)
316316
def temporal(self, node: ast.TemporalPredicate, lhs, rhs):

0 commit comments

Comments
 (0)