{"result":{"depiction_url":null,"edges":{"observes":{"objects":[{"created":"2026-09-09T13:47:46Z","object_id":{"id":1628,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_filewatcher","title":"observe_filewatcher\/2","uri":"https:\/\/zotonic.com\/id\/1628"},"seq":1},{"created":"2026-09-09T13:47:46Z","object_id":{"id":1981,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_rsc_update_done","title":"observe_rsc_update_done\/2","uri":"https:\/\/zotonic.com\/id\/1981"},"seq":2},{"created":"2026-09-09T13:47:46Z","object_id":{"id":1982,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_search_query","title":"observe_search_query\/2","uri":"https:\/\/zotonic.com\/id\/1982"},"seq":3},{"created":"2026-09-09T13:47:46Z","object_id":{"id":2005,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_module_activate","title":"observe_module_activate\/2","uri":"https:\/\/zotonic.com\/id\/2005"},"seq":4},{"created":"2026-09-09T13:47:46Z","object_id":{"id":2050,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_rsc_delete","title":"observe_rsc_delete\/2","uri":"https:\/\/zotonic.com\/id\/2050"},"seq":5},{"created":"2026-09-09T13:47:46Z","object_id":{"id":2094,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_custom_pivot","title":"observe_custom_pivot\/2","uri":"https:\/\/zotonic.com\/id\/2094"},"seq":6}],"predicate":{"id":2550,"is_a":["meta","predicate"],"name":"observes","title":{"_type":"trans","tr":{"en":"Observes"}},"uri":"https:\/\/zotonic.com\/id\/observes"}},"references":{"objects":[{"created":"2020-05-30T05:47:54Z","object_id":{"id":1844,"is_a":["text","documentation","reference","model"],"name":"doc_model_model_search","title":"search","uri":"https:\/\/zotonic.com\/id\/1844"},"seq":1000000},{"created":"2020-05-30T05:47:54Z","object_id":{"id":1728,"is_a":["text","documentation","reference"],"name":"doc_developerguide_configuration_site_configuration","title":"Site configuration","uri":"https:\/\/zotonic.com\/id\/1728"},"seq":1000000},{"created":"2020-05-30T05:47:54Z","object_id":{"id":1638,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_search","title":{"_type":"trans","tr":{"en":"Search"}},"uri":"https:\/\/zotonic.com\/id\/1638"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}},"refers":{"objects":[{"created":"2026-09-09T13:47:46Z","object_id":{"id":1844,"is_a":["text","documentation","reference","model"],"name":"doc_model_model_search","title":"search","uri":"https:\/\/zotonic.com\/id\/1844"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"relation":{"objects":[{"created":"2020-05-30T05:47:54Z","object_id":{"id":1638,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_search","title":{"_type":"trans","tr":{"en":"Search"}},"uri":"https:\/\/zotonic.com\/id\/1638"},"seq":1000000},{"created":"2020-05-30T05:47:54Z","object_id":{"id":1575,"is_a":["text","documentation","cookbook"],"name":"doc_cookbook_custom_search","title":"Custom search","uri":"https:\/\/zotonic.com\/id\/1575"},"seq":1000000}],"predicate":{"id":303,"is_a":["meta","predicate"],"name":"relation","title":{"_type":"trans","tr":{"nl":"Relatie","en":"Relation"}},"uri":"http:\/\/purl.org\/dc\/terms\/relation"}},"subject":{"objects":[{"created":"2026-09-09T13:47:46Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:47:46Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":2},{"created":"2026-09-09T13:47:46Z","object_id":{"id":2586,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_search_and_discovery","title":"Search and discovery","uri":"https:\/\/zotonic.com\/id\/2586"},"seq":3},{"created":"2026-09-09T13:47:46Z","object_id":{"id":2629,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_pivot_index","title":"Pivot and search index","uri":"https:\/\/zotonic.com\/id\/2629"},"seq":4},{"created":"2026-09-09T13:47:46Z","object_id":{"id":2631,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_database","title":"Database","uri":"https:\/\/zotonic.com\/id\/2631"},"seq":5},{"created":"2026-09-09T13:47:46Z","object_id":{"id":2635,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_module","title":"Module","uri":"https:\/\/zotonic.com\/id\/2635"},"seq":6},{"created":"2026-09-09T13:47:46Z","object_id":{"id":2643,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_query","title":"Query","uri":"https:\/\/zotonic.com\/id\/2643"},"seq":7}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2060,"is_a":["text","documentation","reference","module"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2060"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_module_mod_search","page_url":{"en":"https:\/\/zotonic.com\/docs\/2060\/mod_search","x-default":"https:\/\/zotonic.com\/docs\/2060\/mod_search"},"preview_url":null,"resource":{"version":3993,"pivot_location_lat":null,"title":"mod_search","is_authoritative":true,"body":"<p>mod_search implements various ways of searching through the main resource table using <a href=\"\/id\/doc_model_model_search\" class=\"doc-reference doc-reference-model\"><code>model#search<\/code><\/a>.<\/p>\n<p>The following searches are implemented in mod_search:<\/p>\n<table class=\"table\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Required arguments<\/th><\/tr><\/thead><tbody><tr><td><code>query<\/code><\/td><td>Very powerful search with which you can implement almost all of the other search functionality. See: <a href=\"\/id\/doc_developerguide_search#guide-datamodel-query-model\">Search<\/a><\/td><td><\/td><\/tr><tr><td><code>facets<\/code><\/td><td>Performs a <code>query<\/code> (see above) and then calculates facets. The facets are defined using the <code>pivot\/facet.tpl<\/code> template. Facets are returned in the <code>facets<\/code> field of the search result. This shows per facet the counts for alternative values.<\/td><td><\/td><\/tr><tr><td><code>subfacets<\/code><\/td><td>Performs a <code>query<\/code> (see above) and then calculates facets. The facets are defined using the <code>pivot\/facet.tpl<\/code> template. Facets are returned in the <code>facets<\/code> field of the search result. This is a <em>drill down<\/em> where the facets are counted from the matching resources in the query. That means that only facet values that are in the result set are shown.<\/td><td><\/td><\/tr><tr><td><code>facet_values<\/code><\/td><td>Returns an empty result with the facets field set to all possible values per facet, or the min\/max range for a range facet.<\/td><td><\/td><\/tr><tr><td><code>featured<\/code><\/td><td>List of pages, featured ones first.<\/td><td><\/td><\/tr><tr><td><code>featured<\/code><\/td><td>List of pages in a category, featured ones first.<\/td><td>cat<\/td><\/tr><tr><td><code>featured<\/code><\/td><td>List of pages in a category having a certain object, featured pages first.<\/td><td>cat, object, predicate<\/td><\/tr><tr><td><code>latest<\/code><\/td><td>The newest pages.<\/td><td><\/td><\/tr><tr><td><code>latest<\/code><\/td><td>The newest pages within in a category.<\/td><td>cat<\/td><\/tr><tr><td><code>upcoming<\/code><\/td><td>Selects pages with future <code>date_end<\/code>.<\/td><td><\/td><\/tr><tr><td><code>upcoming_on<\/code><\/td><td>Selects pages with <code>date_end<\/code> after the given time.<\/td><td><code>datetime<\/code><\/td><\/tr><tr><td><code>upcoming_date<\/code><\/td><td>Selects pages with <code>date_end<\/code> after the given date.<\/td><td><code>date<\/code><\/td><\/tr><tr><td><code>finished<\/code><\/td><td>Selects pages with a past <code>date_end<\/code>.<\/td><td><\/td><\/tr><tr><td><code>finished_on<\/code><\/td><td>Selects pages with a <code>date_end<\/code> before the given time.<\/td><td><code>datetime<\/code><\/td><\/tr><tr><td><code>finished_date<\/code><\/td><td>Selects pages with a <code>date_end<\/code> before the given date.<\/td><td><code>date<\/code><\/td><\/tr><tr><td><code>unfinished<\/code><\/td><td>Selects pages with a <code>date_end<\/code> in the future.<\/td><td><\/td><\/tr><tr><td><code>unfinished_on<\/code><\/td><td>Selects pages with a <code>date_end<\/code> after the given time.<\/td><td><code>datetime<\/code><\/td><\/tr><tr><td><code>unfinished_date<\/code><\/td><td>Selects pages with a <code>date_end<\/code> after the given date.<\/td><td><code>date<\/code><\/td><\/tr><tr><td><code>ongoing<\/code><\/td><td>Pages with past <code>date_start<\/code> and future <code>date_end<\/code>.<\/td><td><\/td><\/tr><tr><td><code>ongoing_on<\/code><\/td><td>Pages with a <code>date_start<\/code> - <code>date_end<\/code> range around the given time.<\/td><td><code>datetime<\/code><\/td><\/tr><tr><td><code>ongoing_date<\/code><\/td><td>Pages with a <code>date_start<\/code> - <code>date_end<\/code> range around the given date.<\/td><td><code>date<\/code><\/td><\/tr><tr><td><code>autocomplete<\/code><\/td><td>Full text search where the last word gets a wildcard.<\/td><td>text<\/td><\/tr><tr><td><code>autocomplete<\/code><\/td><td>Full text search where the last word gets a wildcard, filtered by category.<\/td><td>cat, text<\/td><\/tr><tr><td><code>fulltext<\/code><\/td><td>Full text search. Returns <code>{id,score}<\/code> tuples.<\/td><td>text<\/td><\/tr><tr><td><code>fulltext<\/code><\/td><td>Full text search, filtered by category. Returns <code>{id,score}<\/code> tuples.<\/td><td>cat, text<\/td><\/tr><tr><td><code>referrers<\/code><\/td><td>All subjects of a page.<\/td><td>id<\/td><\/tr><tr><td><code>media_category_image<\/code><\/td><td>All pages with a medium and within a certain category. Used to find category images.<\/td><td><code>cat<\/code><\/td><\/tr><tr><td><code>media_category_depiction<\/code><\/td><td>All pages with a depiction edge to an image. Used to find category images.<\/td><td><code>cat<\/code><\/td><\/tr><tr><td><code>media<\/code><\/td><td>All pages with a medium, ordered by descending creation date.<\/td><td><\/td><\/tr><tr><td><code>all_bytitle<\/code><\/td><td>Return all <code>{title,id}<\/code> pairs for a category, sorted on title.<\/td><td>cat<\/td><\/tr><tr><td><code>all_bytitle_featured<\/code><\/td><td>Return all <code>{title,id}<\/code> pairs for a category, sorted on title, featured pages first<\/td><td>cat<\/td><\/tr><tr><td><code>all_bytitle<\/code><\/td><td>Return all <code>{title,id}<\/code> pairs for a category without subcategories, sorted on title.<\/td><td><code>cat_is<\/code><\/td><\/tr><tr><td><code>all_bytitle_featured<\/code><\/td><td>Return all <code>{title,id}<\/code> pairs for a category without subcategories, sorted on title, featured pages first.<\/td><td><code>cat_is<\/code><\/td><\/tr><tr><td><code>match_objects<\/code><\/td><td>Returns a list of pages with similar object ids to the objects of the given resource with the given id. Accepts optional <code>cat<\/code> parameters for filtering on category. Optionally accepts a <code>predicate<\/code> parameter to only use the objects that are connected to the given <code>id<\/code> using the predicate or predicates.<\/td><td><code>id<\/code><\/td><\/tr><tr><td><code>match_objects_cats<\/code><\/td><td>Returns a list of pages with similar object ids or categories. Accepts an optional <code>cat<\/code> parameter for filtering on category.<\/td><td><code>id<\/code><\/td><\/tr><tr><td><code>archive_year<\/code><\/td><td>Returns an overview on publication year basis, for a specified category. Every row returned has parts: <code>as_date<\/code>, <code>year<\/code> and <code>count<\/code>. The order is descending, newest year first.<\/td><td><code>cat<\/code><\/td><\/tr><tr><td><code>archive_year_month<\/code><\/td><td>Return a grouped “archive” overview of resources within a category. The result is a double list, consisting of <code>[ {year, [ months ] }]<\/code>. The result is grouped on publication year and month, and includes counts. The order is descending, newest year first.<\/td><td><code>cat<\/code><\/td><\/tr><tr><td><code>keyword_cloud<\/code><\/td><td>Return a list of <code>{keyword_id, count}<\/code> for all resources within a given category. The list is ordered on keyword title. Default predicate is <code>subject<\/code>, default category is <code>keyword<\/code>. Change optional <code>keywordpred<\/code> and <code>keywordcat<\/code> to create a different cloud.<\/td><td><code>cat<\/code>, <code>keywordpred<\/code>, <code>keywordcat<\/code><\/td><\/tr><tr><td><code>previous<\/code><\/td><td>Given an id, return a list of “previous” ids in the given category. This list is ordered by publication date, latest first.<\/td><td>id, cat<\/td><\/tr><tr><td><code>next<\/code><\/td><td>Given an id, return a list of “next” ids in the given category. This list is ordred by publication date, oldest first.<\/td><td>id, cat<\/td><\/tr><\/tbody><\/table>\n<h2>Configuration<\/h2>\n<p>There are two <a href=\"\/id\/doc_developerguide_configuration_site_configuration#ref-site-configuration\">site configuration\nvariables<\/a> to tweak <a href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/textsearch-controls.html\">PostgreSQL text\nsearch settings<\/a>.<\/p>\n<h3>mod_search.rank_behaviour<\/h3>\n<p>An integer representation to influence PostgreSQL search behaviour.<\/p>\n<p>Default: <code>37<\/code> (<code>1 | 4 | 32<\/code>)<\/p>\n<h3>mod_search.rank_weight<\/h3>\n<p>A set of four numbers to override relative weights for the ABCD categories.<\/p>\n<p>Default: <code>{0.05, 0.25, 0.5, 1.0}<\/code><\/p>\n<h2>Accepted Events<\/h2>\n<p>This module handles the following notifier callbacks:<\/p>\n<ul><li><code>observe_custom_pivot<\/code>: Populate facet pivot columns during resource indexing for search facets.<\/li><li><code>observe_filewatcher<\/code>: Rebuild facet tables when watched search facet definition files change.<\/li><li><code>observe_module_activate<\/code>: Trigger asynchronous initialization when the search module is activated.<\/li><li><code>observe_module_reindexed<\/code>: Check the search facet table if all modules are running and the indexer reindexed using <code>search_facet:ensure_table<\/code>.<\/li><li><code>observe_search_query<\/code>: Execute supported full-text and facet search query operators.<\/li><\/ul>\n<p>Delegate callbacks:<\/p>\n<ul><li><code>event\/2<\/code> with <code>postback<\/code> messages: <code>facet_rebuild<\/code>.<\/li><\/ul>","slug":"mod_search","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"03c5d4914e0d584eb741646044cbbc1ee38b98d178bc25d154357b50dd54bfb7","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":320,"is_a":["meta","category"],"name":"module","title":"Modules","uri":"https:\/\/test.zotonic.com\/id\/320"},"doc_source_path":"apps\/zotonic_mod_search\/src\/mod_search.erl","publication_start":"2023-06-24T08:17:43Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_search\/src\/mod_search.erl","pivot_location_lng":null,"doc_source_kind":"module","name":"doc_module_mod_search","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:54Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_search","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"85498256abd162b9bc082d43a90c995844fd4408\n","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-09-29T14:40:11Z","title_slug":"mod_search"},"uri":"https:\/\/zotonic.com\/id\/2060","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2060"}},"status":"ok"}