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
QueryTemplateManager
Assembly: Lucene.Net.QueryParser.dll
Syntax
public class QueryTemplateManager
Constructors
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)
Declaration
public QueryTemplateManager()
QueryTemplateManager(Stream)
This class makes a virtual AddDefaultQueryTemplate call. If you need to subclass it
and make this call at a time when it suits you, use QueryTemplateManager() instead
Declaration
public QueryTemplateManager(Stream xslIs)
Parameters
Type |
Name |
Description |
Stream |
xslIs |
|
Methods
AddDefaultQueryTemplate(Stream)
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)
Declaration
public virtual void AddDefaultQueryTemplate(Stream xslIs)
Parameters
Type |
Name |
Description |
Stream |
xslIs |
|
AddQueryTemplate(string, Stream)
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)
Declaration
public virtual void AddQueryTemplate(string name, Stream xslIs)
Parameters
GetQueryAsDOM(IDictionary<string, string>)
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)
Declaration
public virtual XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties)
Parameters
Returns
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
Returns
GetQueryAsDOM(IDictionary<string, string>, string)
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)
Declaration
public virtual XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties, string queryTemplateName)
Parameters
Returns
Fast means of constructing query using a cached,precompiled stylesheet
Declaration
public static XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties, XslCompiledTransform template)
Parameters
Returns
GetQueryAsXmlString(IDictionary<string, string>)
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)
Declaration
public virtual string GetQueryAsXmlString(IDictionary<string, string> formProperties)
Parameters
Returns
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
Returns
GetQueryAsXmlString(IDictionary<string, string>, string)
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)
Declaration
public virtual string GetQueryAsXmlString(IDictionary<string, string> formProperties, string queryTemplateName)
Parameters
Returns
Fast means of constructing query using a precompiled stylesheet
Declaration
public static string GetQueryAsXmlString(IDictionary<string, string> formProperties, XslCompiledTransform template)
Parameters
Returns
GetTemplates(Stream)
Parses a query stylesheet for repeated use
Declaration
public static XslCompiledTransform GetTemplates(Stream xslIs)
Parameters
Type |
Name |
Description |
Stream |
xslIs |
|
Returns
Slower transformation using an uncompiled stylesheet (suitable for development environment)
Declaration
public static void TransformCriteria(IDictionary<string, string> formProperties, Stream xslIs, Stream result)
Parameters
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