Module z_search

Search the database, interfaces to specific search routines.

Copyright © 2009-2021 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Search the database, interfaces to specific search routines.

Data Types

search_offset()

search_offset() = pos_integer() | {Offset::pos_integer(), Limit::pos_integer()}

search_query()

search_query() = {atom(), list()} | {binary(), map() | undefined}

Function Index

concat_sql_query/2
props_to_map/1Change a search props list to a map with binary keys.
query_/2Given a query as proplist or map, return all results.
search/2(Deprecated.) Search with the question and return the results.
search/3(Deprecated.) Perform the named search and its arguments.
search/5Perform a named search with arguments.
search_pager/3(Deprecated.) Search items and handle the paging.
search_pager/4Search items and handle the paging.
search_result/3Handle a return value from a search function.

Function Details

concat_sql_query/2

concat_sql_query(Search_sql, Limit1) -> any()

props_to_map/1

props_to_map(Props::proplists:proplist() | map()) -> #{binary() => term()}

Change a search props list to a map with binary keys.

query_/2

query_(Args::proplists:proplist() | map(), Context::z:context()) -> [m_rsc:resource_id()]

Given a query as proplist or map, return all results.

search/2

search(Search::{atom() | binary(), proplists:proplist() | map()}, Context::z:context()) -> #search_result{}

This function is deprecated: use search/5

Search with the question and return the results

search/3

search(Search::search_query(), MaxRows::search_offset() | undefined, Context::z:context()) -> #search_result{}

This function is deprecated: use search/5

Perform the named search and its arguments

search/5

search(Name, Args, Page, PageLen, Context) -> Result

Perform a named search with arguments.

search_pager/3

search_pager(Search::search_query(), Page::pos_integer(), Context::z:context()) -> #search_result{}

This function is deprecated: use search/5

Search items and handle the paging. Uses the default page length.

search_pager/4

search_pager(Search::search_query(), Page::pos_integer(), PageLen::pos_integer(), Context::z:context()) -> #search_result{}

Search items and handle the paging

search_result/3

search_result(Result, Limit::search_offset(), Context) -> #search_result{}

Handle a return value from a search function. This can be an intermediate SQL statement that still needs to be augmented with extra ACL checks.


Generated by EDoc