Class QueryTemplateManager
Provides utilities for turning query form input (such as from a web page or Swing gui) into
Lucene XML queries by using XSL templates. This approach offers a convenient way of externalizing
and changing how user input is turned into Lucene queries.
Database applications often adopt similar practices by externalizing SQL in template files that can
be easily changed/optimized by a DBA.
The static methods can be used on their own or by creating an instance of this class you can store and
re-use compiled stylesheets for fast use (e.g. in a server environment)
Inheritance
System.Object
QueryTemplateManager
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.QueryParser.dll
Syntax
public class QueryTemplateManager
Constructors
|
Improve this Doc
View Source
QueryTemplateManager()
Declaration
public QueryTemplateManager()
|
Improve this Doc
View Source
QueryTemplateManager(Stream)
Declaration
public QueryTemplateManager(Stream xslIs)
Parameters
Type |
Name |
Description |
System.IO.Stream |
xslIs |
|
Methods
|
Improve this Doc
View Source
AddDefaultQueryTemplate(Stream)
Declaration
public virtual void AddDefaultQueryTemplate(Stream xslIs)
Parameters
Type |
Name |
Description |
System.IO.Stream |
xslIs |
|
|
Improve this Doc
View Source
AddQueryTemplate(String, Stream)
Declaration
public virtual void AddQueryTemplate(string name, Stream xslIs)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.IO.Stream |
xslIs |
|
|
Improve this Doc
View Source
GetQueryAsDOM(IDictionary<String, String>)
Declaration
public virtual XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
formProperties |
|
Returns
Type |
Description |
System.Xml.XmlDocument |
|
|
Improve this Doc
View Source
GetQueryAsDOM(IDictionary<String, String>, Stream)
Slow means of constructing query - parses stylesheet from input stream
Declaration
public static XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties, Stream xslIs)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
formProperties |
|
System.IO.Stream |
xslIs |
|
Returns
Type |
Description |
System.Xml.XmlDocument |
|
|
Improve this Doc
View Source
GetQueryAsDOM(IDictionary<String, String>, String)
Declaration
public virtual XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties, string queryTemplateName)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
formProperties |
|
System.String |
queryTemplateName |
|
Returns
Type |
Description |
System.Xml.XmlDocument |
|
|
Improve this Doc
View Source
Fast means of constructing query using a cached,precompiled stylesheet
Declaration
public static XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties, XslCompiledTransform template)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
formProperties |
|
System.Xml.Xsl.XslCompiledTransform |
template |
|
Returns
Type |
Description |
System.Xml.XmlDocument |
|
|
Improve this Doc
View Source
GetQueryAsXmlString(IDictionary<String, String>)
Declaration
public virtual string GetQueryAsXmlString(IDictionary<string, string> formProperties)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
formProperties |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GetQueryAsXmlString(IDictionary<String, String>, Stream)
Slow means of constructing query parsing a stylesheet from an input stream
Declaration
public static string GetQueryAsXmlString(IDictionary<string, string> formProperties, Stream xslIs)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
formProperties |
|
System.IO.Stream |
xslIs |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GetQueryAsXmlString(IDictionary<String, String>, String)
Declaration
public virtual string GetQueryAsXmlString(IDictionary<string, string> formProperties, string queryTemplateName)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
formProperties |
|
System.String |
queryTemplateName |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Fast means of constructing query using a precompiled stylesheet
Declaration
public static string GetQueryAsXmlString(IDictionary<string, string> formProperties, XslCompiledTransform template)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
formProperties |
|
System.Xml.Xsl.XslCompiledTransform |
template |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GetTemplates(Stream)
Parses a query stylesheet for repeated use
Declaration
public static XslCompiledTransform GetTemplates(Stream xslIs)
Parameters
Type |
Name |
Description |
System.IO.Stream |
xslIs |
|
Returns
Type |
Description |
System.Xml.Xsl.XslCompiledTransform |
|
|
Improve this Doc
View Source
Slower transformation using an uncompiled stylesheet (suitable for development environment)
Declaration
public static void TransformCriteria(IDictionary<string, string> formProperties, Stream xslIs, Stream result)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
formProperties |
|
System.IO.Stream |
xslIs |
|
System.IO.Stream |
result |
|
|
Improve this Doc
View Source
Fast transformation using a pre-compiled stylesheet (suitable for production environments)
Declaration
public static void TransformCriteria(IDictionary<string, string> formProperties, XslCompiledTransform transformer, Stream result)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
formProperties |
|
System.Xml.Xsl.XslCompiledTransform |
transformer |
|
System.IO.Stream |
result |
|