|
Filtering
Spinn3r server-side API filtering.
Spinn3r 3.1 implements a new feature for server-side filtering of API results. We match results against a boolean expression on our end and only send you the matching documents. This can significantly save on bandwidth and indexing costs as well as making the API easier to work with. This code requires a version of the Spinn3r reference client greater than 3.1.15. LanguageThe language uses a domain specific language similar to Lisp or s-expressions. All operations use prefix notation. OperatorsWe support the operators and, or, eq, contains andBoth expressions must be true orEither expressions must be true. eqthe given variable must equal the given scalar. containsthe given variable must contain the given scalar. notDoes not match the following expression. ExamplesFiltering by Language(contains dc:lang "en") Allowing all language other than english(not (contains dc:lang "en")) Filtering contentYou can match on either the post:body, post:content_extract, or description fields. See Spinn3rFields for more information. (contains post:body "Linux") (contains post:content_extract "Linux") (contains description "Linux") AdvancedHere are some advanced examples: Finding Microblog content from Twitter(and (eq source:publisher_type "MICROBLOG") (contains source:resource "twitter.com")) Command Line UsageThe command line supports a --remote-filter option which allows you to pass a filter to be called on our servers.
java \
-Xmx512M \
-cp spinn3r-client-3.1.15-rc8.jar \
com.spinn3r.api.Main \
--vendor=VENDOR_CODE \
--api=comment \
--remote-filter='(eq dc:lang "it")'
|
Sign in to add a comment
in msdos window ,the command need changing a bit .since space would be treated as division of argv string parameters .
the last line above should be changed to : --remote-filter="(eq dc:lang \"it\")"
(note:the ("")is used to enclose a string parameter containing space character . (\)is used to contain (") as a character in a string parameter