Hi Thomas,

yes, that solution should (mostly) work and use the index for searching.
There's only a single issue (that's why I wrote "mostly"): the extra 
character in the second subcondition ("!") should compare < than any other 
character, not >. 
So using the "!" character is already quite good, because it actually 
compares lower than other ASCII characters except TAB (which you can 
probably ignore) and the space character.
 
The other solution posted by Scott will also work, but it will not use an 
index, because a function is applied on the indexed values before 
comparison.

Best regards
Jan

Am Mittwoch, 5. April 2017 14:44:09 UTC+2 schrieb Thomas Weiss:
>
> Hi everyone,
>
> A nice little issue that I've just encountered! :)
>
> I need to provide a case-insensitive search on some string field, where 
> the beginning of the string should suggest the different results.
> Ex: 'thom' and 'Thom' should find 'Thomas'
>
> Initially, I used a full-text index and it worked really great... until we 
> found out that some users had special characters like dots in their 
> usernames: 'i.M.O' for example. I guess that the full-text index strips all 
> punctuations, so those don't get indexed.
>
> So my current idea is to:
> - create a composite field that contains the lower-cased username
> - use a skiplist index on that field
> - search with FILTER newField >= 'query' && newField < 'query!'
> NOTE that '!' would be a character that is > than any other one; I still 
> have to find which character that would be as it seems that the normal 
> ASCII order is not respected: RETURN 'z' < '~' return false
>
> Any comment would be greatly appreciated!
>
> Thanks,
> Thomas
>

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to