0.x
  • User Guide
  • Developer Guide
  • Cookbooks
  • Best Practices
  • Reference
    • Modules
      • Module listing
        • mod_acl_adminonly
        • mod_acl_user_groups
        • mod_admin
        • mod_admin_category
        • mod_admin_config
        • mod_admin_frontend
        • mod_admin_identity
        • mod_admin_merge
        • mod_admin_modules
        • mod_admin_predicate
        • mod_artwork
        • mod_atom
        • mod_atom_feed
        • mod_auth2fa
        • mod_authentication
        • mod_backup
        • mod_base
        • mod_base_site
        • mod_bootstrap
        • mod_clamav
        • mod_comment
        • mod_component
        • mod_contact
        • mod_content_groups
        • mod_custom_redirect
        • mod_development
        • mod_editor_tinymce
        • mod_email_dkim
        • mod_email_receive
        • mod_email_relay
        • mod_email_status
        • mod_export
        • mod_facebook
        • mod_filestore
        • mod_geoip
        • mod_import_csv
        • mod_import_wordpress
        • mod_instagram
        • mod_l10n
        • mod_linkedin
        • mod_logging
        • mod_mailinglist
        • mod_media_exif
        • mod_menu
        • mod_mqtt
        • mod_oauth
        • mod_oembed
        • mod_ratelimit
        • mod_rest
        • mod_search
        • mod_seo
        • mod_seo_sitemap
        • mod_signal
        • mod_signup
        • mod_ssl
        • mod_ssl_self_signed
        • mod_survey
        • mod_tkvstore
        • mod_translation
        • mod_twitter
        • mod_video
        • mod_video_embed
    • Actions
    • Controllers
    • All dispatch rules
    • Filters
    • Models
    • Services
    • Builtin Tags
    • Custom Tags
    • Validators
    • Directory structure
    • Icons
    • Notifications
    • Installation requirements
    • Global configuration
    • Site configuration
    • The Status site
    • Command-line
    • Transport
    • Troubleshooting
    • EDoc reference
  • Glossary
Zotonic
  • Docs »
  • Reference »
  • Modules »
  • mod_search
  • Edit on GitHub

mod_search¶

mod_search implements various ways of searching through the main resource table using model-search.

Configuration¶

There are two site configuration variables to tweak PostgreSQL text search settings.

mod_search.rank_behaviour¶

An integer representation to influence PostgreSQL search behaviour.

Default: 37 (1 | 4 | 32)

mod_search.rank_weight¶

A set of four numbers to override relative weights for the ABCD categories.

Default: {0.05, 0.25, 0.5, 1.0}

The following searches are implemented in mod_search:

Name Description Required arguments
featured List of pages, featured ones first.  
featured List of pages in a category, featured ones first. cat
featured List of pages in a category having a certain object, featured pages first. cat, object, predicate
latest The newest pages.  
latest The newest pages within in a category. cat
upcoming Selects pages with future date_end.  
finished Selects pages with a past date_end.  
ongoing Pages with past date_start and future date_end.  
autocomplete Full text search where the last word gets a wildcard. text
autocomplete Full text search where the last word gets a wildcard, filtered by category. cat, text
fulltext Full text search. Returns {id,score} tuples. text
fulltext Full text search, filtered by category. Returns {id,score} tuples. cat, text
referrers All subjects of a page. id
media_category_image All pages with a medium and within a certain category. Used to find category images. cat
media_category_depiction All pages with a depiction edge to an image. Used to find category images. cat
media All pages with a medium, ordered by descending creation date.  
all_bytitle Return all {id,title} pairs for a category, sorted on title. cat
all_bytitle_featured Return all {id,title} pairs for a category, sorted on title, featured pages first cat
all_bytitle Return all {id,title} pairs for a category without subcategories, sorted on title. cat_is
all_bytitle_featured Return all {id,title} pairs for a category without subcategories, sorted on title, featured pages first. cat_is
match_objects Returns a list of pages with similar object ids to the objects of the given resource with the given id. Returns {id, rank}. Accepts optional cat parameters for filtering on category. id
match_objects_cats Returns a list of pages with similar object ids or categories. Returns {id, rank} tuples. Accepts an optional cat parameter for filtering on category. id
query Very powerful search with which you can implement almost all of the other search functionality. See: Search  
archive_year Returns an overview on publication year basis, for a specified category. Every row returned has parts: “as_date”, “year” and “count”. The order is descending, newest year first. cat
archive_year_month Return a grouped “archive” overview of resources within a category. The result is a double list, consisting of [ {year, [ months ] }]. The result is grouped on publication year and month, and includes counts. The order is descending, newest year first. cat
keyword_cloud Return a list of {keyword_id, count} for all resources within a given category. The list is ordered on keyword title. Default predicate is subject, default category is keyword. Change optional keywordpred and keywordcat to create a different cloud. cat, keywordpred, keywordcat
previous Given an id, return a list of “previous” ids in the given category. This list is ordered by publication date, latest first. id, cat
next Given an id, return a list of “next” ids in the given category. This list is ordred by publication date, oldest first. id, cat

See also

Search

Next Previous

© Copyright 2009–2017, The Zotonic Project (zotonic.com). Revision 5a5a6ce5.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: 0.x
Versions
latest
stable
0.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.