Chapter 6. Subsections

Table of Contents
6.1. Tags
6.2. Categories

6.1. Tags

Tag is a special parameter which can be given for a set of documents. The main purpose of tags is to join a number of documents into one group and then while doing search to select a group of documents to search through.

You should use Tag command of indexer.conf to assign some tag value for a server or server subset by putting it before corresponding Server/Realm/Subnet command. While doing search you can specify tag value to search through documents which tag matches given parameter with t=xxx parameter, which can be passed from HTML form. Take a look into Section 6.1.1>, indexer.conf-dist and search.htm-dist for explanation and examples.

Note: For dbmode cache you need to have the following section defined in your sections.conf file:

Section tag 0 64
in overall you need to have the section 'tag' defined with non-zero maximum length.

6.1.1. Tag command

Tag <string>

Use this field for your own purposes. For example for grouping some servers into one group, etc... During search you'll be able to limit URLs to be searched through by their tags. Can be set multiple times before Server command and takes effect till the end of config file or till next Tag command. Default values is an empty string.

6.1.2. TagIf command

TagIf <tag> [Match|NoMatch] [NoCase|Case] [String|Regex] [loose] <section> <arg> [<arg> ... ]

Mark document by <tag> tag, if the value of section match the arg pattern given. The meaning of first three optional parameters are exactly the same as for the Allow command (see Section 3.10.14>). Optional parameter loose specify to do not override the tag value if it has been already set from server parameters.

Example

TagIf Docs regex Title Manual

You can use template meta-variables (as for example, $(Title), $(Last-Modified), etc.) in <tag> tag. An example below shows how to assign hostname from URL as a tag for any document indexed:

TagIf $(url.host) match url.host *

6.1.3. Tags in SQL version

Tag type is CHAR. CHAR type allows to use some nice features. You can use '_' and '%' LIKE wildcards in tag parameter when doing search. It makes possible that tag, like a category, does support an idea of nesting. For example, documents with tag value "AB" can be found with both "A%" and "AB" tag limits.

Tags also give a way to make an URL a member of multiple tag selections. Playing with LIKE wildcards you can easily create two or more groups.

For example, tag "ABCDE" is the member of at least these selections:

_BCDE
A_CDE
AB_DE
ABC_E
ABCD_

Note: If you have big enough database and often use tag limits, it is useful to create an index by field "tag" in "server" table. This index is not created by default.

CREATE INDEX srv_tag ON "server" ("tag");

By default, the length of tag field in url table is limited by 16 characters. If you need more, increase this length before DB creating.

Note: For cache storage mode, you can use SQL's wildcards only with indexer.