NeowayLabs / neosearch

Full Text Search Library
30 stars 4 forks source link

Slug the reverse index names #32

Closed i4ki closed 9 years ago

i4ki commented 9 years ago

The reverse index per field created inside a database index require a special sanitization before use for the database name.

For example, the document below will not successfully index:

{
    "credit card": 8687678
}

because the validateIndexName checks the valid characters for index name and space isn't a valid character.

I suggest apply a slug function to drop unsupported characters instead of hash the index names on disk.