Class Extensions
The Extensions class represents an extension mapping to associate ParserExtension instances with extension keys. An extension key is a string encoded into a Lucene standard query parser field symbol recognized by ExtendableQueryParser. The query parser passes each extension field token to SplitExtensionField(String, String) to separate the extension key from the field identifier.
In addition to the key to extension mapping this class also defines the field name overloading scheme. ExtendableQueryParser uses the given extension to split the actual field name and extension key by calling SplitExtensionField(String, String). To change the order or the key / field name encoding scheme users can subclass Extensions to implement their own.
Inheritance
Inherited Members
Assembly: Lucene.Net.QueryParser.dll
Syntax
[Serializable]
public class Extensions
Constructors
Name | Description |
---|---|
Extensions() | Creates a new Extensions instance with the DEFAULT_EXTENSION_FIELD_DELIMITER as a delimiter character. |
Extensions(Char) | Creates a new Extensions instance |
Fields
Name | Description |
---|---|
DEFAULT_EXTENSION_FIELD_DELIMITER | The default extension field delimiter character. This constant is set to ':' |
Properties
Name | Description |
---|---|
ExtensionFieldDelimiter | Returns the extension field delimiter |
Methods
Name | Description |
---|---|
Add(String, ParserExtension) | Adds a new ParserExtension instance associated with the given key. |
BuildExtensionField(String) | Builds an extension field string from a given extension key and the default query field. The default field and the key are delimited with the extension field delimiter character. This method makes no assumption about the order of the extension key and the field. By default the extension key is appended to the end of the returned string while the field is added to the beginning. Special Query characters are escaped in the result. Note: Extensions subclasses must maintain the contract between BuildExtensionField(String) and BuildExtensionField(String, String) where the latter inverts the former. |
BuildExtensionField(String, String) | Builds an extension field string from a given extension key and the default query field. The default field and the key are delimited with the extension field delimiter character. This method makes no assumption about the order of the extension key and the field. By default the extension key is appended to the end of the returned string while the field is added to the beginning. Special Query characters are escaped in the result. Note: Extensions subclasses must maintain the contract between BuildExtensionField(String) and BuildExtensionField(String, String) where the latter inverts the former. |
EscapeExtensionField(String) | Escapes an extension field. The default implementation is equivalent to Escape(String). |
GetExtension(String) | Returns the ParserExtension instance for the given key or if no extension can be found for the key.
|
SplitExtensionField(String, String) | Splits a extension field and returns the field / extension part as a Tuple{string,string}. This method tries to split on the first occurrence of the extension field delimiter, if the delimiter is not present in the string the result will contain a value for the extension key and
the given field string as the field value. If the given extension field
string contains no field identifier the result pair will carry the given
default field as the field value.
|