GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ELASTICSEARCH::UTIL (3)

.ds Aq ’

NAME

ElasticSearch::Util - Util subs for ElasticSearch

CONTENTS

DESCRIPTION

ElasticSearch::Util provides various subs useful to other modules in ElasticSearch.

The only sub useful to users is filter_keywords(), which can be exported.

SYNOPSIS



    use ElasticSearch::Util qw(filter_keywords);

    my $filtered = filter_keywords($unfiltered)



SUBROUTINES

filter_keywords()

This tidies up a string to be used as a query string in (eg) search() in ElasticSearch 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 ElasticSearch::QueryParser which gives you much more control over your query strings.

The current implementation does the following:
o Removes any character which isn’t a letter, a number, a space or
-+"*@._.
o Removes and, or and not
o Removes any - that doesn’t have a space in front of it ( foo -bar)
is acceptable as it means foo but not with bar
o Removes any space after a + or -
o Removes any + or - which is not followed by a letter, number
or a double quote
o Removes any * that doesn’t have at least 3 letters before it, ie
we only allow wildcard searches on words with at least 3 characters
o Closes any open double quotes
o Removes leading and trailing whitespace
YMMV

LICENSE AND COPYRIGHT

Copyright 2010 - 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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ELASTICSEARCH::UTIL (3) 2013-09-24

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.