Skip to main content

Introduction

This package provides a complete user interface for AdvancedQuery by Dieter Maurer. It enables you to use a powerful language to search for content. It also provides functionality to save parametrized and conditional queries for later use (predefined queries). Look at the examples for more information.

Installation

  • Put anthill.querytool in eggs= and zcml=

  • Make sure that AdvancedQuery is installed (works for Plone 3.x)

Example query

A query could look like that:

And(
    Eq('SearchableText', '$text'),
    ~Generic('path', {'query':'Members', 'level':-1}),

    [[if($allowed_types)]]
        In('portal_types', $allowed_types),
    [[endif]]

    [[ifnot($allowed_types)]]
        In('portal_types', ['Folder', 'Document']),
    [[endif]]

    Ge('start_date', TODAY)
)

Here you see that you can parametrize queries (variable expansion enabled using $), you also can use defined constants (only one currently active called TODAY where TODAY=DateTime()) and you can put conditionals in your queries.

Conditionals are a powerful way to enable or disable certain parts of your query. The if statement checks if a given parameter exists. You can also replace if with ifnot that only activates the given part if the parameter is not set.

You can save this query and call it later on like that:

context.query_tool.executePredefinedQuery('contentsearch', text='Test*', allowed_types=['Folder', ])

Extensions

This release adds some additional query operators (defined in SearchOperators.py). The following operators are currently available:

  • Count counts items in search results. (e.g. Count(Eq(‘SearchableText’, ‘moses’)) )

  • Sum computes sum over int result (e.g. Sum(Ge(‘commentcount’, 10)) )

  • Avg computes the average over an int result (e.g. Avg(Ge(‘userviews’, 1)) )

Look at SearchOperators.py for examples on how to create your own operators.

Submit query

http://files.banality.de/public/anthill.querytool.submit.jpg

Predefined queries

http://files.banality.de/public/anthill.querytool.predefined.jpg

Thanks

  • Markus Reinsch for coding the predecessor of this package

  • Dieter Maurer for his great implementation of AdvancedQuery

Changelog

0.2 - 2009/08/21

  • Revamped documentation [spamsch]

0.1 - 2009/08/20

  • Initial release

Metadata

Release files for anthill.querytool 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anthill.querytool 0.2
File Size Uploaded Provenance
anthill.querytool-0.2.tar.gz 16.6 kB Without provenance Details

Release files / anthill.querytool-0.2.tar.gz

Download URL anthill.querytool-0.2.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
94b89b32220a88c1d84d830438a357e633505354591200145724f34254a3698a
BLAKE2b-256 checksum
How to use checksums
dea7099fb0a54dedd96a827e6559a2b0b3b79dc62ab6950adaea1650d9fd28c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for anthill.querytool 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page