Skip to content

query and utf-8 encoding issues #10

@sirkosi

Description

@sirkosi

Hi,

I had trouble getting some results through my queries so I modified the code a little.

At first I had some issues with the generated query which generated the following query:
Built query: {u'tags.highway': {'$exists': True}}

After I modified map_server.py:307 into this:

groups = re.findall(r'(?:\[(.*?)\])', xapiQuery.encode("utf-8"))

The map_server.py seems to generate now the correct strings without the prefix 'u'.

Also, in my generated Mongo DB the 'tags' in each element are called 'tg' and the wildcard query did not look very correct to me, so I modified map_server:326-329 into this:

elif right == u'*':
  q['ky'] = { '$in': [left] }
else:
  q['tg'] = [left, right]

I tested the new queries with the modified map_server.py and MongoHub.
Could someone confirm or deny my changes? Thanks in advance.

Best regards

PS I'm not a python programmer, so my changes might be not very stylish

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions