You can create any number of categories for a collection,
and each category can contain any number of rules. The rules determine
which documents are associated automatically with the category.
About this task
If your applications enable support for categories, users
can narrow results by selecting categories in the facet navigation
pane. When a user selects a category, only the documents that belong
to the selected category are shown in the search results.
Important: If you change category rules after you crawl and
index documents, the index becomes inconsistent. To ensure the accuracy
of search results, all documents in the collection must be crawled
or imported again and then re-indexed again. If the collection is
configured to use the document cache, you can rebuild the index without
recrawling or re-importing documents.
If a user has the
authority to create category rules, the rules that the user adds are
displayed in the category tree. You can see the user IDs of the application
users who added rules and edit or remove these rules. Unless the application
user also has authority to rebuild the category index, the categories
are not reflected in the user application until you rebuild the category
index.
Procedure
To configure a rule-based category:
- On the Collections view, expand the
collection that you want to configure. In the Parse and
Index pane, click .
- On the Rule-based Categories page,
select the category that you want to configure:
- Select the default root category if you want to add a category
at the top level in the category tree. You cannot edit the definition
of the default root category or remove the default root category from
the tree.
- Select an individual category in the tree if you want to add
a subcategory to a category. You can edit the category rules, change
the order of the subcategories, or remove the category or subcategory
from the tree. You can nest subcategories to define the hierarchy
in which the categories are displayed when users query a collection.
- Add a category.
You must specify the
category path, which is an ID that enables the category to be used
programmatically. The following special characters and alphanumeric
characters are supported: hyphen (-), underscore (_), 0-9, a-z, and
A-Z.
You can also specify a display name for the category. If you
do not specify a category name, the category path is used as the display
name.
Tip: The category path ensures the uniqueness of
each category. If you specify a category name, you might want to ensure
that each name is unique, too. Users might be confused by seeing more
than one category with same name when they query a collection.
- In the category tree, select the category that you added
and click the button to edit category rules.
A list of
currently defined rules is displayed. You can see the rule name, the
type of rule, the content of the rule, the user ID of the user who
added the rule through an application (if any), the query language
to be used with documents that belong to the category, and the date
and time that the rule was last modified. You can change how the rules
are displayed:
- Click the header of the column that you want to sort the rules
by. To reverse the sort order, click the column header again.
- Limit the list to rules that match a pattern that you specify.
In the Filter by field, select how you want
to filter the rules (by the name of the rule, by the text that defines
the rule, or by user ID) and then type the characters that rules must
contain. As you type, the list of rules is dynamically updated to
show only the rules that match.
- Add a rule:
- On the Rules page, click Add.
- On the Add Rule page, type a name
for the rule if you are configuring rules for an enterprise search
collection. The rule name is not required for content analytics collections.
The rule can be based on URI patterns or document content:
- URI pattern rules
- To use the URI of a document to determine whether the document
belongs to the category, click URI pattern and
then specify the URI pattern. If the text that you specify exists
in the URI, the document is associated with the category. For example:
file:///c:/program+files/finance
- Document content rules
- To determine whether a document belongs to the category by querying
searchable content, click Document content,
select the language of the documents, and then specify the words and
phrases that must or must not appear in the document content. If a
document includes or excludes the words that you specify, the document
is associated with the category.
You express the rule in the same
format as a query. For example:
+finance -accounting
+title:"fiscal year"
The rulebased::category-id query
operator is not supported.
After you click OK,
the Rules page shows the rule that you created.
You can add another rule, edit a rule, or remove a rule that you previously
added.
- After you finish configuring rules for this category,
click OK to return to the Rule-based
Categories page.
- Optional: Change the order of the categories
in the tree.
You can change the hierarchical structure
of the category tree in two ways:
- Dragging categories
- You can select and drag subcategories to different locations in
the tree. You cannot drag the root category and you cannot drag a
subcategory to a top-level position below the root category. The system
provides indicators to let you know where you can drop a category
or subcategory that you selected to drag. You can use the Ctrl key
to select multiple subcategories from the same category and drag them
together to a new position in the tree. You cannot select and drag
subcategories that belong to different categories.
- Moving categories
- Select the root category to organize top-level categories, or
select a category to organize the subcategories of that category.
When you click the Edit icon in the Category
order area, a list of all subcategories for the selected
category is displayed. Select a subcategory and click the appropriate
buttons to move the subcategory up, down, or to the first or last
position in the category.