Difference between revisions of "LuceneFastDocument class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=<nowiki>LuceneFastDocument</nowiki> |Description=<nowiki>Document to used for fast indexing</nowiki> |Constructors= {{CGscriptConstructors_Templ...")
(Tag: visualeditor-switched)
 
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
|Name=<nowiki>LuceneFastDocument</nowiki>
 
|Name=<nowiki>LuceneFastDocument</nowiki>
 
|Description=<nowiki>Document to used for fast indexing</nowiki>
 
|Description=<nowiki>Document to used for fast indexing</nowiki>
|Constructors=
+
|InheritsFrom=LuceneDocument|Constructors=
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptParameters_Template|Type=array|Name=<nowiki>fields</nowiki>|Description=<nowiki>Fields that needs to be stored for this document</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>storeValues</nowiki>|Description=<nowiki>If true, the value for the given index can be extracted from the search result</nowiki>}}
 
{{CGscriptParameters_Template|Type=array|Name=<nowiki>fields</nowiki>|Description=<nowiki>Fields that needs to be stored for this document</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>storeValues</nowiki>|Description=<nowiki>If true, the value for the given index can be extracted from the search result</nowiki>}}
 
|Description=<nowiki>Initialize fast document for adding in loop. The doc instance can be reused in the loop for less memory usage and faster processing. Notice this sets some fields to empty or 0, where as the non-fast version doesnt include them in document at all</nowiki>}}
 
|Description=<nowiki>Initialize fast document for adding in loop. The doc instance can be reused in the loop for less memory usage and faster processing. Notice this sets some fields to empty or 0, where as the non-fast version doesnt include them in document at all</nowiki>}}
 
|Methods=
 
|Methods=
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>AddField</nowiki>|Parameters=
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>AddField</nowiki>|Inherited=LuceneDocument|Parameters=
 
{{CGscriptParameters_Template|Type=LuceneColumn|Name=<nowiki>type</nowiki>|Description=<nowiki>Which column to store value in</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=object|Name=<nowiki>value</nowiki>|Description=<nowiki>Value to save</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>storeValue</nowiki>|Description=<nowiki>If true, the value can be extracted from the search result</nowiki>}}
 
{{CGscriptParameters_Template|Type=LuceneColumn|Name=<nowiki>type</nowiki>|Description=<nowiki>Which column to store value in</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=object|Name=<nowiki>value</nowiki>|Description=<nowiki>Value to save</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>storeValue</nowiki>|Description=<nowiki>If true, the value can be extracted from the search result</nowiki>}}
 
|Description=<nowiki>Add a new field to the document. Multiple calls are valid for the same column, and it is not necessary to add values for all columns</nowiki>}}
 
|Description=<nowiki>Add a new field to the document. Multiple calls are valid for the same column, and it is not necessary to add values for all columns</nowiki>}}
{{CGscriptMethods_Template|ReturnType=object|Name=<nowiki>GetField</nowiki>|Parameters=
+
{{CGscriptMethods_Template|ReturnType=object|Name=<nowiki>GetField</nowiki>|Inherited=LuceneDocument|Parameters=
 
{{CGscriptParameters_Template|Type=LuceneColumn|Name=<nowiki>type</nowiki>|Description=<nowiki>Which column to get value from</nowiki>}}
 
{{CGscriptParameters_Template|Type=LuceneColumn|Name=<nowiki>type</nowiki>|Description=<nowiki>Which column to get value from</nowiki>}}
 
|Description=<nowiki>Get the values for a given field. Only valid if storeValue was true when updating the document</nowiki>}}
 
|Description=<nowiki>Get the values for a given field. Only valid if storeValue was true when updating the document</nowiki>}}
{{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>GetFields</nowiki>|Parameters=
+
{{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>GetFields</nowiki>|Inherited=LuceneDocument|Parameters=
 
{{CGscriptParameters_Template|Type=LuceneColumn|Name=<nowiki>type</nowiki>|Description=<nowiki>Which column to get values from</nowiki>}}
 
{{CGscriptParameters_Template|Type=LuceneColumn|Name=<nowiki>type</nowiki>|Description=<nowiki>Which column to get values from</nowiki>}}
 
|Description=<nowiki>Get the values for a given field. Only valid if storeValue was true when updating the document</nowiki>}}
 
|Description=<nowiki>Get the values for a given field. Only valid if storeValue was true when updating the document</nowiki>}}
Line 22: Line 22:
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>fieldIndex</nowiki>|Description=<nowiki>Index of which field to set value on</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=object|Name=<nowiki>value</nowiki>|Description=<nowiki>Value to save</nowiki>}}
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>fieldIndex</nowiki>|Description=<nowiki>Index of which field to set value on</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=object|Name=<nowiki>value</nowiki>|Description=<nowiki>Value to save</nowiki>}}
 
|Description=<nowiki>Set a new field to the document. Multiple calls are valid for the same column, and it is not necessary to add values for all columns</nowiki>}}
 
|Description=<nowiki>Set a new field to the document. Multiple calls are valid for the same column, and it is not necessary to add values for all columns</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>|Inherited=LuceneDocument|Description=<nowiki>The string representation of the object.</nowiki>}}
 
|Properties=
 
|Properties=
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Explain</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Explain why the search found this document</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Explain</nowiki>|HasGetter=1|HasSetter=1|Inherited=LuceneDocument|Description=<nowiki>Explain why the search found this document</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Id</nowiki>|HasGetter=1|Description=<nowiki>Id of the document</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Id</nowiki>|HasGetter=1|Inherited=LuceneDocument|Description=<nowiki>Id of the document</nowiki>}}
 
{{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=number|Name=<nowiki>ResultScore</nowiki>|HasGetter=1|Description=<nowiki>The score generated by Lucene for this search result</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>ResultScore</nowiki>|HasGetter=1|Inherited=LuceneDocument|Description=<nowiki>The score generated by Lucene for this search result</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|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 
}}
 
}}
 +
=== <span style="color:#DF8621">'''Note'''</span> ===
 +
LuceneFastDocument should only have 1 constructor, the other constructors are not valid

Latest revision as of 05:39, 2 July 2020

LuceneFastDocument


Document to used for fast indexing

Parent class

Inherits from LuceneDocument

Constructors

  • (array fields "Fields that needs to be stored for this document", array storeValues "If true, the value for the given index can be extracted from the search result") - Initialize fast document for adding in loop. The doc instance can be reused in the loop for less memory usage and faster processing. Notice this sets some fields to empty or 0, where as the non-fast version doesnt include them in document at all

Methods

  • (From LuceneDocument) Empty AddField(LuceneColumn type "Which column to store value in", object value "Value to save", bool storeValue "If true, the value can be extracted from the search result") - Add a new field to the document. Multiple calls are valid for the same column, and it is not necessary to add values for all columns
  • (From LuceneDocument) object GetField(LuceneColumn type "Which column to get value from") - Get the values for a given field. Only valid if storeValue was true when updating the document
  • (From LuceneDocument) array GetFields(LuceneColumn type "Which column to get values from") - Get the values for a given field. Only valid if storeValue was true when updating the document
  • Empty Reset(string id "Id") - Reset and set a new Id. Must be called first in any iteration
  • Empty SetField(int fieldIndex "Index of which field to set value on", object value "Value to save") - Set a new field to the document. Multiple calls are valid for the same column, and it is not necessary to add values for all columns
  • (From LuceneDocument) string ToString() - The string representation of the object.

Properties

  • (From LuceneDocument) string Explain { get; set; } - Explain why the search found this document
  • (From LuceneDocument) string Id { get; } - Id of the document
  • string ObjectTypeName { get; } - The name of the type of object.
  • (From LuceneDocument) number ResultScore { get; } - The score generated by Lucene for this search result
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.

Note

LuceneFastDocument should only have 1 constructor, the other constructors are not valid