RegainManual--索引及属性

In the Search index the data about a document is stored in separate fields. This way you can decide which fields you want to be regarded when searching. 

在搜索索引中,关于文件(document)的数据存放在不同的属性(field)中。通过这种方式,可以在搜索中选择不同的属性(field)(进行筛选、排序等)

Using auxiliary fields you're able to define more fields besides the standard fields. This helps you to search more precisely. 

使用辅助属性(auxiliary fields),可以自定义标准属性(standard fields)之外的属性。这样可以实现更加准确的搜索。

How can I use this feature?  用法举例:

Example 1: Generate an auxiliary field from the URL

1:从URL中生成辅助属性

 Assumed you have a network drive with a projects folder, which contains a sub folder for each project.  

假设网络驱动器上有工程文件夹,文件夹内有每一个工程的子目录:

c:

+-- projects

    +-- gullivers

    +-- regain

    +-- marvin

    +-- blubb

    +-- ...

 In this case you may for example add an auxiliary field project, which contains for each document the name of the project the document belongs to. A search for manual project:regain” would the search for the keyword manual” in all documents in the project folder regain. 

在这一例子中,可以加一个辅助属性:“工程”,属性中存放每一个document所在的工程的名字。对于"manual projectregain"的查找将在regain工程文件夹中寻找manual关键字。

 For this auxiliary field you even may add a list box to the advanced search. This way you're able to select directly a certain project to search in. 

对于这个辅助属性,甚至可以加一个列表框来实现高级搜索。通过这种方式可以实现选择某一工程并对其内容进行查找。

 To realize that example, you have to add the following entry to the ''auxiliaryFieldList'' tag in the CrawlerConfiguration.xml: 

为了实现这一例子,必须在CrawlerConfiguration.xml中的'auxiliaryFieldList标签中中加入以下入口:

<auxiliaryFieldList>

  <auxiliaryField name="project" regexGroup="1">

    <regex>^file://c:/projects/([^/]*)</regex> 

  </auxiliaryField>

</auxiliaryFieldList>

 The Regular expressions defines, which documents are provided with the auxiliary field. The attribute regexGroup causes that the value of the auxiliary field is extracted from the first regex group: ([^/]*). 

 With the URL file://c:/projects/marvin/docs/manual.pdf the auxiliary field project gets the value marvin. 

 The URL file://c:/docs/letter.doc does not match the regular expression and therefore gets no auxiliary field project. 

Example 2: Sub collection

 Instead of extracting the value of the auxiliary field from the URL, you may also specify a fixed value. 除了从URL中解析出辅助属性的值,也可以具体规定一个固定的值。

 Assumed you have stored certain document types in certain folders on a network drive. E.g. your letters are stored in three different places. Using auxiliary fields you may limit a search on one document type. For example you may only search in your letters. 

假设已经在网络驱动器上的某些文件夹中存储某些文件类型。比如,信件存储在三个不同的地方。使用辅助属性,可以限定一个搜索在某一文件类型内。比如,可以仅仅在“信件”范围内搜索。

 The according entry in the CrawlerConfiguration.xml may look like this: 

CrawlerConfiguration.xml中相应的入口可以是这样的:

<auxiliaryFieldList>

  <auxiliaryField name="doctype" value="letter">

    <regex>^file://c:/projects/letters</regex>

  </auxiliaryField>

 

  <auxiliaryField name="doctype" value="letter">

    <regex>^file://e:/office/customer/(letters|correspondence)</regex>

  </auxiliaryField>

 

  <auxiliaryField name="doctype" value="offer">

    <regex>^file://e:/office/customer/offers/</regex>

  </auxiliaryField>

 

  <auxiliaryField name="doctype" value="specs">

    <regex>/spec(ification)?/</regex>

  </auxiliaryField>

</auxiliaryFieldList>

 With the first two entries all documents in c:/projects/letters, e:/office/customer/letters and e:/office/customer/correspondence get an auxiliary field doctype with the value letter. 

通过前两个条目,c:/projects/letters, e:/office/customer/letters e:/office/customer/correspondence中所有的文件都获得了一个辅助属性“doctype”,它的值同时被设为“letter

 The third entry causes that all documents in e:/office/customer/offers get an auxiliary field doctype with the value offer. 

第三个条目使得 e:/office/customer/offers中所有的文件获得了一个值为“offer”的辅助属性。

 With the last entry all documents having anywhere in their URL a /spec/ or a /specification/ get an auxiliary field doctype with the value specs. 

通过最后一个条目所有在URL中符合一定规范/格式的文件,获得一个“doc”属性,这个属性的值为“specs

 All other document get no auxiliary field doctype. 所有其他的文件没有获得“doctype”属性

SearchIndex索引

The search index stores the data about the documents in a way, so that documents containing a certain key word may be found rapidly on search request. Because of the index's smart design a search over many thousands of documents can be performed in parts of a second. 

Search index通过某种方式存储文件相关的数据,因此在发出搜索请求时,包含某个关键字的文件会被迅速地找出来。正是由于index这种巧妙的设计,对于成千上万的文件的查找才得以快速完成。

 regain uses Lucene for the index creation and the index based search. Lucene separates the data about a document in several classified fields. So you may decide which fields shall be queried. 

Regain使用lucene创建index和完成使用index的搜索。Lucene将关于一个文件的数据切分为不同的属性。使用时可以选择需要被查询的属性。

 A search request regain extension:pdf” for instance will look for regain in the default fields as well as for pdf inside the extension field. 

比如,搜索请求“regain extentionpdf”将在默认属性中和扩展属性值为“pdf”的文件中查找“regain

 What fields are seeked by default, will be configured in file SearchConfiguration.xml using the tag ''searchFieldList''. The default search fields are content, title and headlines. 

Standard fields

默认的查找属性,在SearchConfiguration.xml中使用'searchFieldList标签可以配置。默认的属性为内容、标题和headlines

 regain creates the following standard fields: 

Regain创建以下的标准属性:

url - The document's URL.文件的URL

content - The document´s text extracted by the Preparators. 预处理解析出的文件内容

title - The document's title (if it has any). 文件的标题(如果有标题的话)

summary - The summary shown in the hit list.在命中表中显示的摘要

headlines - The headlines (if there are any) contained in the document.在文件中包含的headlines(如果有的话)

size - The document's size in bytes (can't be searched).文件的字节大小(不可被搜索)

last-modified - The date of the last change in the YYYY-MM-DD HH:MM format (can't be searched). 最后修改时间,格式是年--日(不可被搜索)

path - The navigation path to the document. (can't be searched)文件的导航路径(不可被搜索)

groups - Contains the user groups that are allowed to read the document. Is set only when the Access rights management is enabled. 包括允许查看的用户组。在权限管理实现的情况下才可设置。

Further fields may be added. The default configuration adds a field extension storing the document´s file extension (e.g. pdf).可以添加更多的属性。默认的配置加入了一个扩展属性存储文件的属性扩展。(例如pdf

 Important Notes: 重要说明:

 If content extraction fails no content field is established! Instead of this the preparation-error field is created and set to true.

如果内容解析失败则任何属性都不会建立!与此相反,preparation-error之一属性将被创建并且设置为true.

 It depends on the capabilities of the preparators used for crawling the files, what will be finally stored in the default fields (e.g. content, title and headlines)!

最终被存入默认属性的内容(比如内容、标题、headlines)取决于预处理的能力。

lukeall or Lucene Index Toolbox may be helpfully to have a look inside the index. 

lukeall或者Lucene Index在查看index内部时或许有用。

The index directory

 In the 'index directory' regain puts the search indexes. The indexes are stored in different sub directories, depending in which phase of their life cycle they are. 

在“index directory”中regain放置搜索索引。索引被存放在不同的子目录下,取决于他们所处的生命周期阶段。

 regain uses the following sub directories: 

Regain使用如下的子目录:

temp - An index in this directory is currently changed by the Crawler.

      目前正在被爬虫修改的index存放于此

breakpoint - Periodically the crawler creates Breakpointss. If the crawler is stopped before it finished the new index (e.g. when the computer is shut down), then it is able to proceed from the last breakpoint when it is started the next time and doesn't have to start from the beginning.爬虫周期性创建断点。若爬虫在完成新的索引的建立前被停止,在下一次启动时,不必再从头开始。

new - When the crawler finished the index, it renames the diretory to new. This directory is the interface between Crawler and Search mask. The search mask regularily checks, if there is an index with the state new in the index directory. If it finds such an index it changes to that index, that is it renames the directory to index. In this way the hot deployment is implemented.

      当爬虫完成索引时,将目录名称改为new。这一目录是爬虫和搜索之间的接口。Search mask经常检查索引目录下是否有声明为new的索引目录。如果查找到则修改这一索引,将其目录名修改为index。这就是热部署实现的方式。

quarantine - If the crawler finished an index but had many errors, the new index doesn't get the state new but quarantine. In this way the Search mask doesn't change to the faulty index automatically. In this case you should check the log file and, if you want to change to that index, rename the directory to new.

如果爬虫完成了一个索引但是其间发生许多错误,那么那个索引不声明为new而是quarantine。通过这种方式,search mask不自动修改错误的索引。这种情况想,应该检查日志文件,如果想修改这一索引,则重命名其目录为new

index - This index is currently used by the search mask.搜索正在使用的索引。

backup - Before the search mask changes to the new index, it renames the old index to backup. If a new index should be faulty, you are able to quickly switch to the previous index by renaming the directory backup to new. search mask修改新的索引之前,将旧的索引命名为backup。如果新的索引出了问题,可以通过将backup命名为new迅速转向旧的索引

<auxiliaryFieldList> tag

role: A list of Auxiliary fields. 

 The Search index may be extended by auxiliary fields that are generated from the document's URL.  搜索索引可以通过从文件的URL中生成的属性扩展。

 Example: Assumed you have a directory with a sub directory for every project. Then you can generate an auxiliary field with the project name. When searching for offer project:otto23 you will only get results from that project directory. 

 The following tag generates an auxiliary field project with the value otto23 from the URL file://c:/projects/otto23/docs/Spez.doc: 

<auxiliaryField name="project" regexGroup="1">

  ^file://c:/projects/([^/]**)

</auxiliaryField>

values: Any number of <auxiliaryField> child tags. 

example: 

<auxiliaryFieldList>

  <auxiliaryField> ... </auxiliaryField>

  <auxiliaryField> ... </auxiliaryField>

  ...

</auxiliaryFieldList>

<auxiliaryField> tag

 Child tag of the  <auxiliaryFieldList> tag. 

role: The definition of an auxiliary field. 

 In order to define the value the auxiliary field should get, use either the attribute value (for fixed values) or the attribute regexGroup (for values extracted from the URL), not both. 

attribute name: The name of the auxiliary field. (value: A name, example: project or system) 

attribute value: The value the auxiliary field should get. (value: A string, example: letters, Since version: 1.1 Beta 6) 

attribute regexGroup: The number of the Regular expressions group that contains the value the auxiliary field should get. (value: A number) 

attribute toLowerCase: Specifies whether the value extracted by regexGroup should be converted to lower case. (value: true or false Optional. Default is true, Since version: 1.1 Beta 6) 

values: A Regular expressions. 

example (value extracted from the URL):

<auxiliaryField name="project" regexGroup="1">^file://c:/projects/([^/]**)</auxiliaryField>

example (fixed value):

<auxiliaryField name="doctype" value="letters">^file://c:/docs/letters</auxiliaryField>

<auxiliaryField name="doctype" value="images">^file://c:/docs/(images|cliparts)</auxiliaryField>

<auxiliaryField name="doctype" value="photos">^file://c:/docs/photos</auxiliaryField>

你可能感兴趣的:(File,Lucene,url,存储,regex,扩展)