05 Mar 2014 15:29:58 UTC
- Distribution: Search-Elasticsearch-Compat
- Module version: 0.10
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (1362 / 0 / 0)
- KwaliteeBus factor: 1
- 94.22% Coverage
- License: apache_2_0
- Download (69.65KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- LICENSE AND COPYRIGHT
- COPYRIGHT AND LICENSE
Search::Elasticsearch::Compat::Util - Provides the filter_keywords utility
use Search::Elasticsearch::Compat::Util qw(filter_keywords); my $filtered = filter_keywords($unfiltered)
This tidies up a string to be used as a query string in (eg) "search()" in Search::Elasticsearch::Compat so that user input won't cause a search query to return an error.
It is not flexible at all, and may or may not be useful to you.
Have a look at Search::Elasticsearch::Compat::QueryParser which gives you much more control over your query strings.
The current implementation does the following:
Removes any character which isn't a letter, a number, a space or
-that doesn't have a space in front of it ( "foo -bar") is acceptable as it means
'foo' but not with 'bar'
Removes any space after a
-which is not followed by a letter, number or a double quote
*that doesn't have at least 3 letters before it, ie we only allow wildcard searches on words with at least 3 characters
Closes any open double quotes
Removes leading and trailing whitespace
Copyright 2009-2013 - 2011 Clinton Gormley.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
Clinton Gormley <email@example.com>
This software is Copyright (c) 2014 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
Module Install Instructions
To install Search::Elasticsearch::Compat, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Search::Elasticsearch::Compat
For more information on module installation, please visit the detailed CPAN module installation guide.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|