User Tools

Site Tools


config:searchconfiguration.xml
Translations of this page:

====== SearchConfiguration.xml ====== The **SearchConfiguration.xml** contains the configuration of the [[:components:search mask]]. ===== Cascaded settings ===== The search mask provides searching several [[:components:search index | indices]]. For each index you can specify, where it is located and how the results of this index should be presented. All settings, except of the index location, may be specified as cascaded settings. I.e. if you didn't specify a setting in the particular ''<index>'' tag, the search mask checks whether you specified it in the ''<defaultSettings>'' tag. If it is missing here too, the default setting is used. That way you can specifiy default settings that apply for all indices. If you want another setting for one index however, you can override the default setting by specifying something else in the particular ''<index>'' tag. ===== The location of the SearchConfiguration.xml ===== In order to load the ''SearchConfiguration.xml'', the [[:components:search mask]] must know where it is located. The [[:project_info:variant_comparison|desktop search]] expects the ''SearchConfiguration.xml'' in the ''conf'' sub directory. The [[:project_info:variant_comparison|server search]] takes the location from the ''web.xml''. The default expects it in the ''conf/regain'' of the tomcat directory. ===== <indexList> tag ===== **role:** Contains the settings for the indices. **values:** Knows the following child tags: * ''<defaultSettings>'': The cascaded default settings. * ''<index>'': The settings for one index. **example:** <code xml> <indexList> <defaultSettings> ... </defaultSettings> <index> ... </index> <index> ... </index> ... </indexList> </code> ==== <defaultSettings> tag ==== Child tag of the [[SearchConfiguration.xml#<indexList> tag | <indexList> tag]]. **role:** The cascaded default settings. **values:** All tags that are allowed in the [[CrawlerConfiguration.xml#<index> tag | <index> tag]], except for the [[CrawlerConfiguration.xml#<dir> tag | <dir> tag]]. **example:** <code xml> <defaultSettings> <openInNewWindowRegex>.(pdf|rtf|doc|xls|ppt|docx|xlsx|pptx)$</openInNewWindowRegex> <useFileToHttpBridge>true</useFileToHttpBridge> <searchFieldList>content title headlines location filename</searchFieldList> <rewriteRules> ... </rewriteRules> <Highlighting>true</Highlighting> <sortResults showsortfieldcontent="false"> <sortEntry id='1' description='relevance desc' order='desc' field='relevance' /> <sortEntry id='2' description='last modified date asc' order='asc' field='last-modified' /> <sortEntry id='3' description='last modified date desc' order='desc' field='last-modified' /> </sortResults> </defaultSettings> </code> === <Highlighting> tag === **role:** Enables or disables the highlighting of the search terms in title and summary of a search hit. Highlighting doesn't work for wildcard searches e.g. regai*. **values:** true or false === <sortResults> tag === **role:** Defines the sorting options for the search mask. **attribute ''showsortfieldcontent'':** A flag for displaying the content of the sort field on the current document. Possible values are **''true''** and **''false''**. Default setting is **''false''**. **values:** <code xml> <sortEntry id='' description='' order='' field='' /> <sortEntry id='' description='' order='' field='' /> .... </code> Each <sortEntry/> defines an entry in the dropdown list on every search page. **attribute ''id'':** The entries in the dropdown list are sorted by ''id''. The ids must be positive. **attribute ''description'':** The shown description in the dropdown list. **attribute ''order'':** The sorting order for lucene. Possible values are **''asc''** and **''desc''** **attribute ''field'':** The document field name on which the sort will be performed. Possible values are: * **''relevance''** (the scoring of the hit regarding to index size and matching on different fields) * **''size''** (the document size) * **''last-modified''** (the last modification date of the document, in case of an web document: the crawling date) * **''filename_sort''** (the filename of the document, without the path) * **''mimetype''** (the detected mimetype of the document) * **''title_sort''** (the title of the document, mostly set for web documents) * **''path_sort''** (the path of the document) **example:** <code xml> <sortResults showsortfieldcontent="false"> <sortEntry id='1' description='relevance desc' order='desc' field='relevance' /> <sortEntry id='2' description='last modified date asc' order='asc' field='last-modified' /> <sortEntry id='3' description='last modified date desc' order='desc' field='last-modified' /> <sortEntry id='4' description='document size asc' order='asc' field='size' /> <sortEntry id='5' description='document size desc' order='desc' field='size' /> <sortEntry id='6' description='file name asc' order='asc' field='filename_sort' /> <sortEntry id='7' description='file name desc' order='desc' field='filename_sort' /> <sortEntry id='8' description='mimetype asc' order='asc' field='mimetype' /> <sortEntry id='9' description='mimetype desc' order='desc' field='mimetype' /> <sortEntry id='10' description='title asc' order='asc' field='title_sort' /> <sortEntry id='11' description='titel desc' order='desc' field='title_sort' /> <sortEntry id='12' description='path asc' order='asc' field='path_sort' /> <sortEntry id='13' description='path desc' order='desc' field='path_sort' /> </sortResults> </code> ==== <index> tag ==== Child tag of the [[SearchConfiguration.xml#<indexList> tag | <indexList> tag]]. **role:** The settings for one [[:components:search index]]. **attribute ''name'':** The name of the index. (**values:** A unique name, **example:** ''mydocs'') **values:** Knows the following child tags: * ''<dir>'': The directory where the [[:components:search index]] is located. * ''<openInNewWindowRegex>'': The [[regular expression]] that matches URLs that should be opened in a new browser window. * ''<useFileToHttpBridge>'': Specifies whether the [[:features:file-to-http-bridge]] should be used for file-URLs. * ''<searchFieldList>'': The [[:components:search index|index field]]s that should be searched by default. * ''<rewriteRules>'': The rules for the url rewriting. **example:** <code xml> <index name="intranet"> <dir>C:\regain\index</dir> <openInNewWindowRegex> ... </openInNewWindowRegex> <useFileToHttpBridge>true</useFileToHttpBridge> <searchFieldList> ... </searchFieldList> <rewriteRules> ... </rewriteRules> </index> </code> or just: <code xml> <index name="mydocs"> <dir>C:\regain\index_mydocs</dir> </index> </code> === <dir> tag === Child tag of the [[SearchConfiguration.xml#<index> tag | <index> tag]]. **role:** The directory where the [[:components:search index]] is located. **values:** A directory. **example:** <code xml> <dir>C:\regain\index</dir> </code> === <openInNewWindowRegex> tag === Child tag of the [[SearchConfiguration.xml#<index> tag | <index> tag]] or the [[SearchConfiguration.xml#<defaultSettings> tag | <defaultSettings> tag]]. **role:** The [[regular expression]] that matches URLs that should be opened in a new browser window. **values:** A [[regular expression]]. **example:** <code xml> <openInNewWindowRegex>.(pdf|rtf|doc|xls|ppt)$</openInNewWindowRegex> </code> === <useFileToHttpBridge> tag === Child tag of the [[SearchConfiguration.xml#<index> tag | <index> tag]] or the [[SearchConfiguration.xml#<defaultSettings> tag | <defaultSettings> tag]]. **role:** Specifies whether the [[:features:file-to-http-bridge]] should be used for file-URLs. **values:** ''true'' or ''false''. **since version:** 1.1 Beta 5 **example:** <code xml> <useFileToHttpBridge>true</useFileToHttpBridge> </code> === <searchFieldList> tag === Child tag of the [[SearchConfiguration.xml#<index> tag | <index> tag]] or the [[SearchConfiguration.xml#<defaultSettings> tag | <defaultSettings> tag]]. **role:** The [[:components:search index|index field]]s that should be searched by default. ''Note:'' The user may also search in other fields using the field operator. See [[:terminology#query syntax]] for details. **values:** A space seaparated list of index field names. **example:** <code xml> <searchFieldList>content title headlines</searchFieldList> </code> === <rewriteRules> tag === Child tag of the [[SearchConfiguration.xml#<index> tag | <index> tag]] or the [[SearchConfiguration.xml#<defaultSettings> tag | <defaultSettings> tag]]. **role:** The rules for the url rewriting. For the result presentation you can use the so called URL-rewriting. I.e. that the URL of the document is changed. This way you can index documents in ''<nowiki>file://c:/www‑data/intranet/docs</nowiki>'' and show the documents in the browser as ''<nowiki>http://intranet.murfman.de/docs</nowiki>''. If none of the rule matches to a URL, it will remain unchanged. **values:** Knows the following child tags: * ''<rule>'': A replacement rule. **example:** <code xml> <rewriteRules> <nowiki><rule prefix="file://c:/example/www-data" replacement="http://www.mydomain.de"/></nowiki> </rewriteRules> </code> == <rule> tag == Child tag of the [[SearchConfiguration.xml#<rewriteRules> tag | <rewriteRules> tag]]. **role:** A replacement rule for the url rewriting. **attribute ''prefix'':** The URL prefix to replace. (**values:** A URL prefix, **example:** ''<nowiki>file://c:/www‑data/intranet/docs</nowiki>'') **attribute ''replacement'':** The URL prefix that should be shown instead. (**values:** A URL prefix, **example:** ''<nowiki>http://intranet.murfman.de/docs</nowiki>'') **example:** With these example attribute values the URL ''<nowiki>file://c:/www‑data/intranet/docs/manual/regain.pdf</nowiki>'' will be changed in ''<nowiki>http://intranet.murfman.de/docs/manual/regain.pdf</nowiki>''. <code xml> <rule prefix="file://c:/example/www-data" replacement="http://www.mydomain.de"/> </code> === <searchAccessController> tag === Child tag of the [[SearchConfiguration.xml#<index> tag | <index> tag]] or the [[SearchConfiguration.xml#<defaultSettings> tag | <defaultSettings> tag]]. **role:** The SearchAccessController to use. This is a part of the [[:features:access rights management]] that ensures that only those documents are shown in the search results that the user is allowed to read. If you specify a ''SearchAccessController'', don't forget to specify the ''CrawlerAccessController'' counterpart in the [[CrawlerConfiguration.xml#<crawlerAccessController> tag | CrawlerConfiguration.xml]]! **values:** Knows the following child tags: * ''<class>'': The class name of the ''SearchAccessController''. * ''<config>'': The configuration of the ''SearchAccessController''. **since version:** 1.1 Beta 4 **example:** <code xml> <searchAccessController> <class jar="myAccess.jar">mypackage.MySearchAccessController</class> <config> ... </config> </searchAccessController> </code> == <class> tag == Child tag of the [[SearchConfiguration.xml#<searchAccessController> tag | <searchAccessController> tag]]. **role:** The class name of the ''SearchAccessController''. **attribute ''jar'':** The name of the jar file, where the ''SearchAccessController'' class is included. May be omitted, if the class is already in the classpath. **values:** A fully classified class name. **since version:** 1.1 Beta 4 **example:** <code xml> <class jar="myAccess.jar">mypackage.MySearchAccessController</class> </code> == <config> tag == Child tag of the [[SearchConfiguration.xml#<crawlerAccessController> tag | <crawlerAccessController> tag]]. **role:** The configuration of the ''SearchAccessController''. **values:** Any number of <param> child tags. **since version:** 1.1 Beta 4 **example:** <code xml> <config> <param name="param1">value1</param> <param name="param2">value2</param> </config> </code> **<param> tag** Child tag of the [[SearchConfiguration.xml#<config> tag | <config> tag]]. **role:** A parameter of the ''SearchAccessController'' configuration. **attribute ''name'':** The name of the parameter (**values:** A parameter name). **values:** The configured value. **since version:** 1.1 Beta 4 **example:** <code xml> <param name="scriptPath">c:\regain\access\getUserGroups.cmd</param> </code>

config/searchconfiguration.xml.txt · Last modified: 2024/09/18 08:31 (external edit)