Dev:GenericFacets

Aus YaCyWiki
Wechseln zu: Navigation, Suche

Generic Search Facets

A faceted search is a feature of a search engine to provide search filters after the search was made. This filters are also called a search navigation. A search navigation is what you see at the right column at the side of a search results where it is possible to reduce the set of result entries with given restrictions.

With YaCy it is very easy to produce generic search facets, which are created by providing a vocabulary for each facet. Do the following:

Create a Vocabulary

A vocabulary is expressed with a set of synonyms for the navigation term in a property-like file.

Vocabulary files are similar to property-files with these rules rules:

  • the key represents the vocabulary term (this is what you see in the navigation)
  • a value is a list of synonyms for the vocabulary term
  • a term is always self-referencing (the term is also a synonym for the term)
  • a value may be omitted (a self-referencing-only vocabulary)

The format of a vocabulary file is:

each line has the format
<print-name>[=<synonym>{','<synonym>}*]
or the line starts with a '#' for comment lines

An actual vocabulary file would look like this:

This is the content of a file named 'OperationSystem.vocabulary'

# list of terms
Linux=Debian,Ubuntu,Fedora,Mandriva,openSUSE,Mint
Windows=Vista,Windows2000,WindowsXP
MacOS
TOS

Activate a Vocabulary

Vocabulary files are activated if they are present in the folder DATA/DICTIONARIES/autotagging/ at start-up time and the vocabulary files must be named with a '.vocabulary' extension.

A vocabulary can be activated by doing:

  • name the vocabulary file as <facet-name>.vocabulary
  • copy the vocabulary to DATA/DICTIONARIES/autotagging/
  • restart

Use the Vocabulary as Search Navigation

Once a vocabulary is activated it is only applied to file that are indexed while the vocabulary is present. Vocabularies cannot be applied to already indexed web pages.

When you have indexed documents with your vocabulary, then try a search: you will see the navigation column with your vocabulary as facet for the search, if in the result set of your search documents are listed which have been tagged using your vocabulary. That means the documents must have any of the word inside that you put into your vocabulary. The search facet is named exactly as you named the vocabulary file excluding the .vocabulary extension.

Examples

These are YaCy search portals which use generic facets: