docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 5.0Web Developer ManualSearch
Copyright © 2012, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com

   

Query Syntax
<search-form>
<search-results>
<search-control>
<search-help>

<search-results></search-results>

Provided by module: Search: Query Module

Creates multipage search results listings.Can be used either as a single tag or as a container. When used as a single tag, it will still behave like a container, but its content is then supplied by the module variable in the Search Query module.

Inside the container a number of entities are supplied that give information about the search. The subtags can be used to create the parts of the search results page.

Use <search-results-entries> to loop through the hits on the current page. Use <search-results-tabs> to loop through all pages in the multipage listing.


Attributes

db="database profile"

The name of the database profile to use for the search. If this attribute is omitted, the form variable 'db' will be used as fallback.


query="text"

The query to run. If this attribute is omitted, the form variable 'query' will be used as a fallback.


query-profile

The name of the query profile to use.


page="number"

The number of the page to show. Page numbering starts at 1. If this attribute is omitted, the form variable 'page' will be used as a fallback. If that variable too is missing, page one will be shown.


perpage="number"

The number of hit entries per each page in the multipage listing. If this attribute is missing, the value will be fetched from the module variable for the Search Query module: 'Default number of results per page'.


type="string"

Either "or" or "and".

"or" means that it is not necessary that all words in the query to be present in a document for it to considered a hit.

"and" means that all words have to be present in the document for it to be considered a hit. The search is for all words in the query.

If a word is preceded by - in the query it is always treated as a "must not have" word. If a word is preceded by + in the query, it is always treated as a "must have" word, even if the type of the search is set to "or".


sort="string"

Either "relevance", "date" or "publdate".

The way the result entries should be sorted. If this attribute is omitted, the form variable 'sort' will be used as fallback.


approx-threshold="number"

Controls the threshold where the search hit count changes from an exact number to an approximation. Setting the value too high will degrade the search performance. Defaults is 10, or the number of hits that fits on a page.


language="string"

The language of the result entries.

If not specified all search hits will be returned regardless of the language, i.e. all language forks will be returned that matches the search query.

If specified to a specific language only entries that either has no language or entries that has the specified language will be returned.


&_.db; (provided by Search: Query Module)

Returns the name of the database profile.


&_.hits; (provided by Search: Query Module)

Returns the total number of hits in the search.


&_.last; (provided by Search: Query Module)

Returns the index of the last hit on the current page. See &_.start;. If the current page is the last page, this value can be less than (&_.start; + &_.perpage; - 1).


&_.nextpage; (provided by Search: Query Module)

Returns the number of the next page. If the current page is the last one, this entity is not set.


&_.page; (provided by Search: Query Module)

Returns the number of the current page.


&_.perpage; (provided by Search: Query Module)

Returns the number of hit entries shown on each page in the multipage listing.


&_.previouspage; (provided by Search: Query Module)

Returns the number of the previous page. If the current page is page one, this entity is not set.


&_.query; (provided by Search: Query Module)

Returns the query of the search.


&_.query-profile; (provided by Search: Query Module)

Returns the name of the query profile.


&_.safe-query; (provided by Search: Query Module)

Returns the query of the search, with non-ascii characters HTTP encoded..


&_.start; (provided by Search: Query Module)

Returns the index of the first hit on the current page. The index of the most significant hit in the search (that is hit entry 1 on page 1), is 1.


&_.time; (provided by Search: Query Module)

Returns the time the search took in seconds, formatted as a decimal number with two decimals.


&_.totalpages; (provided by Search: Query Module)

Returns the total number of pages in the multipage listing.


&_.type; (provided by Search: Query Module)

Returns the type of the search, one of the strings "or" (for search on most words) or "and" (for search on all words).


&_.words; (provided by Search: Query Module)

Returns a string with the words in the search, separated by commas. Only the wanted words are included, so any words preceded by - in the query are omitted here.


<search-results-entries></search-results-entries>

Provided by module: Search: Query Module

Create a listing of the entries on the current page.

If the site uses multilanguage pages special care has to be taken to make sure the link to the page also selects the correct language. Since all sites can have a custom way to select the language (hostname, cookie, prestate etc) the default template does not contain this logic.


&_.body; (provided by Search: Query Module)

Returns the beginning (200 characters) of the body of the document. Occurrences of the matching words are surrounded by <b> tags, to highlight them. Since this entity has a value with HTML code in it, you have to insert it without HTML quoting, like this: &_.body:none;.


&_.content-type; (provided by Search: Query Module)

Returns the MIME content type of the current document.


&_.counter; (provided by Search: Query Module)

Returns the index of the current hit entry within the hit entries on the current page. Starts at 1.


&_.date; (provided by Search: Query Module)

Returns the last modified date of the current document, or '-' if no date has been found. See also &_.isodate;.


&_.description; (provided by Search: Query Module)

Returns the description of the current document, if it has been indexed from a Sitebuilder Workarea, and metadata indexing is switched on. Otherwise, this entity is not present.


&_.isodate; (provided by Search: Query Module)

Returns the last modified date of the current document in ISO format, or '-' if no date has been found. See also &_.date;.


&_.language; (provided by Search: Query Module)

Returns the language code of the hit (the page that matched the query in the search), or an empty string if language neutral.


&_.nice-size; (provided by Search: Query Module)

Returns the approximate size of the current document, formatted as a number with one decimal, followed by the appropriate unit (one of 'bytes', 'kb', 'Mb', 'Gb', 'Tb', or 'Hb').


&_.nice-title; (provided by Search: Query Module)

A bold-highlighted html version of title. Use the 'none' quoting: &_.nice-title:none;


&_.nice-uri; (provided by Search: Query Module)

The same as &_.uri;, but only the part of the URI following "//:".


&_.number; (provided by Search: Query Module)

Returns the index of the current hit entry within all hits in the search. Starts at &_.start; and ends at &_.last;.


&_.publdate; (provided by Search: Query Module)

Returns the publication date of the current document, or '-' if no publication date has been found. See also &_.date; and &_.isodate;.


&_.score; (provided by Search: Query Module)

Returns the score of the current document (in percent), with one decimal and trailing percent sign.


&_.size; (provided by Search: Query Module)

Returns a number with the size of the current document in bytes. See also &_.nice-size;.


&_.title; (provided by Search: Query Module)

Returns the title of the document, or "Untitled" if the document has no title.


&_.uri; (provided by Search: Query Module)

Returns the URI of the hit (the page that matched the query in the search).


<search-results-tabs></search-results-tabs>

Provided by module: Search: Query Module

Create a list of links to the pages in the listing. This tag loops through all the pages in the multipage listing, each page containing &_.perpage; hit entries. If this tag is used as a single tag, it's content is fetched from the module variable.


&_.counter; (provided by Search: Query Module)

Returns the number of the iteration, starting at 1. (Same as &_.targetpage;, but added for clarity.)


&_.targetlast; (provided by Search: Query Module)

Returns the index of the last hit entry on the page.


&_.targetpage; (provided by Search: Query Module)

Returns the page number of the page.


&_.targetstart; (provided by Search: Query Module)

Returns the index of the first hit entry on the page.