-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable strips #108
Configurable strips #108
Conversation
Hi, @dblock any chance to fix CI ? |
I'm really not actively involved in this project, I just brought it into the mongoid org. But if nobody steps up I could help out maybe. Would appreciate some PRs and happy to look and merge for trivial things like CI of course. |
@dblock Thx |
a20e794
to
2aaa10d
Compare
2aaa10d
to
e9d8b30
Compare
@sveredyuk check out Travis result. Your last commit "Sort filtered keys" damages functionality. And I suppose it's out of "configurable strips" feature scope. Without that change all tests are passing well |
@rtrv Hm... ok. I'll try to revert it. It was so time ago that I really don't remember why this code was changed but not committed. |
This reverts commit e9d8b30.
@sveredyuk I have an abbreviation field in my search criteria. However, an abbreviation such as B.E. is saved as two different keywords 'B' and 'E'. How can I ignore the dots while creating keywords for this field using configurable strips? |
@ Mohakjuneja You need one keyword like "BE" ? |
@Mohakjuneja here is the default configuration for gem initialization: config.strip_symbols = /[._:;'\"`,?|+={}()!@#%^&*<>~\$\-\\\/\[\]]/ You can just remove the dot out of the regex: config.strip_symbols = /[_:;'\"`,?|+={}()!@#%^&*<>~\$\-\\\/\[\]]/ Then you'll be able to search for "B.E." including dots and from the string config.strip_accents = /[^\s\p{Alnum}]/ To the following, adding the dot: config.strip_accents = /[.^\s\p{Alnum}]/ Don't forget to reindex by
|
Thank you so much! That works! |
Any suggestion how to change the above to correctly index MAC addresses and IP addresses? When I try the above,I get this :( < test(staging)> Camera.active.map(&:_keywords)
=> [[], [], [], [], [], [], [], [], [":::::"], [], [":::::"], [":::::"], [":::::"]] |
Ah, this does what I want: config.strip_symbols = /[_;'\"`,?|+={}()!@#%^&*<>~\$\-\\\/\[\]]/
config.strip_accents = /[^\s\p{Alnum}.:]/ |
Fixed #106