Difference between revisions of "LuceneIndexCreator class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=<nowiki>LuceneIndexCreator</nowiki> |Description=<nowiki>Creates and updates lucene indexes to help find things</nowiki> |Constructors= {{CGscri...")
(Tag: visualeditor-switched)
 
Line 3: Line 3:
 
|Description=<nowiki>Creates and updates lucene indexes to help find things</nowiki>
 
|Description=<nowiki>Creates and updates lucene indexes to help find things</nowiki>
 
|Constructors=
 
|Constructors=
{{CGscriptConstructors_Template|Parameters=
+
{{CGscriptConstructors_Template|Description=<nowiki>Instanciate index creator to manipulate index</nowiki>}}
{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>Name of the index</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Resource to check permissions on</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>columns</nowiki>|Description=<nowiki>The column configuration. This MUST be the same every time every time for the same index, or a new index must be created</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>overwriteExisting</nowiki>|Description=<nowiki>If true, overwrite existing index, e.g. if changing column configuration</nowiki>}}
 
|Description=<nowiki>Instanciate index creator to create or update index</nowiki>}}
 
 
|Methods=
 
|Methods=
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>DeleteIds</nowiki>|Parameters=
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>DeleteIds</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=array|Name=<nowiki>documentsIds</nowiki>|Description=<nowiki>Documents to delete</nowiki>}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>Name of the index</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Resource to check permissions on</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>columns</nowiki>|Description=<nowiki>The column configuration. This MUST be the same every time every time for the same index, or a new index must be created</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>documentsIds</nowiki>|Description=<nowiki>Document ids to delete</nowiki>}}
|Description=<nowiki>Delete documents from index. Atleast 1 update is required to make the deletes actually occur</nowiki>}}
+
|Description=<nowiki>Delete documents from index</nowiki>}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Destroy</nowiki>|Description=<nowiki>Delete all files associated with the index</nowiki>}}
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Destroy</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>Name of the index</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Resource to check permissions on</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>columns</nowiki>|Description=<nowiki>The column configuration. This MUST be the same every time every time for the same index, or a new index must be created</nowiki>}}
 +
|Description=<nowiki>Delete all files associated with the index</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>UpdateOrAddDocuments</nowiki>|Parameters=
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>UpdateOrAddDocuments</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=array|Name=<nowiki>documents</nowiki>|Description=<nowiki>Documents to update/add</nowiki>}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>Name of the index</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Resource to check permissions on</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>columns</nowiki>|Description=<nowiki>The column configuration. This MUST be the same every time every time for the same index, or a new index must be created</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>overwriteOldIndex</nowiki>|Description=<nowiki>Overwrite any existing index</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>documents</nowiki>|Description=<nowiki>Documents to update/add</nowiki>}}
|Description=<nowiki>Update documents in index, or add if not already there. Note this may throw exceptions if called simultaneously on multiple server for the same index. It is therefore recommended it is called from cattask at specific times</nowiki>}}
+
|Description=<nowiki>Create, update or overwrite index</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>UpdateOrAddDocuments</nowiki>|Parameters=
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>UpdateOrAddDocuments</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=array|Name=<nowiki>sourceData</nowiki>|Description=<nowiki>Array to iterate over and call the callback</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Function|Name=<nowiki>callback</nowiki>|Description=<nowiki>Callback that get each sourceData element as parameter, and must return either a Document or Empty</nowiki>}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>Name of the index</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Resource to check permissions on</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>columns</nowiki>|Description=<nowiki>The column configuration. This MUST be the same every time every time for the same index, or a new index must be created</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>overwriteOldIndex</nowiki>|Description=<nowiki>Overwrite any existing index</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>sourceData</nowiki>|Description=<nowiki>Array to iterate over and call the callback</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Function|Name=<nowiki>callback</nowiki>|Description=<nowiki>Callback that get each sourceData element as parameter, and must return either a LuceneDocument or Empty</nowiki>}}
|Description=<nowiki>Stream updates or adding documents in index, which may vastly reduce memory usage, otherwise similar to overload</nowiki>}}
+
|Description=<nowiki>Create, update or overwrite index by stream updates or adding documents, which may vastly reduce memory usage, otherwise similar to overload</nowiki>}}
 
|Properties=
 
|Properties=
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
 
}}
 
}}

Revision as of 09:19, 21 June 2017

LuceneIndexCreator



Creates and updates lucene indexes to help find things

Constructors

  • () - Instanciate index creator to manipulate index

Methods

  • Empty DeleteIds(string name "Name of the index", int parentResourceId "Resource to check permissions on", array columns "The column configuration. This MUST be the same every time every time for the same index, or a new index must be created", array documentsIds "Document ids to delete") - Delete documents from index
  • Empty Destroy(string name "Name of the index", int parentResourceId "Resource to check permissions on", array columns "The column configuration. This MUST be the same every time every time for the same index, or a new index must be created") - Delete all files associated with the index
  • string ToString() - The string representation of the object.
  • Empty UpdateOrAddDocuments(string name "Name of the index", int parentResourceId "Resource to check permissions on", array columns "The column configuration. This MUST be the same every time every time for the same index, or a new index must be created", bool overwriteOldIndex "Overwrite any existing index", array documents "Documents to update/add") - Create, update or overwrite index
  • Empty UpdateOrAddDocuments(string name "Name of the index", int parentResourceId "Resource to check permissions on", array columns "The column configuration. This MUST be the same every time every time for the same index, or a new index must be created", bool overwriteOldIndex "Overwrite any existing index", array sourceData "Array to iterate over and call the callback", Function callback "Callback that get each sourceData element as parameter, and must return either a LuceneDocument or Empty") - Create, update or overwrite index by stream updates or adding documents, which may vastly reduce memory usage, otherwise similar to overload

Properties

  • string ObjectTypeName { get; } - The name of the type of object.
  • TypeInformation TypeInformation { get; } - Get information about this class.