scholrly / neo4django

Drop-in Neo4j/Django integration.
GNU General Public License v3.0
357 stars 83 forks source link

EDIT: icontains case not covered when dealing with StringArrayProperties #235

Open tonjo opened 10 years ago

tonjo commented 10 years ago

Row 353 in query.py:

elif condition.operator in (OPERATORS.CONTAINS, OPERATORS.ICONTAINS):
    if isinstance(field._property, StringProperty):

EDIT: The icontains check should cover the StringArrayProperty case.

Temporary workaround is quite easy: search the .lower() version of the string, provided the StringArray contains lowercase strings.

mhluongo commented 10 years ago

@tonjo when there's no index, this can be solved pretty easily in Cypher. Maybe icontains against an array property should always go straight to the Cypher case, instead of trying to be clever with index usage?

tonjo commented 10 years ago

Not sure I understood this. Are you suggesting to solve it directly with a Cypher query? Besides, field is indexed, and as workaround I'm cycling through the StringArray.