Namespace Lucene.Net.QueryParsers.Flexible.Core.Messages
Messages usually used by query parser implementations.
Query Parser Messages
Messages for the Flexible Query Parser use .NET Resources. See How to create user-defined exceptions with localized exception messages.
Classes
QueryParserMessages
A strongly-typed resource class, for looking up localized strings, etc.
The localized resources can be replaced by end users by calling the SetResourceProvider(IResourceProvider) method and supplying an instance of QueryParserResourceProvider with custom ResourceManager instances provided in its constructor.QueryParserMessages.SetResourceProvider(new QueryParserResourceProvider(SomeResource.ResourceManager, SomeOtherResource.ResourceManager));
SomeResource
and SomeOtherResource
are auto-generated designer classes which can be generated by Visual Studio when adding
resource files (.resx) to a project. These resources can optionally be localized in different cultures and optionally be distributed as satellite
assemblies. See the ResourceManager documentation for tips on how to get started, but do note this is a broad topic.
QueryParserResourceProvider makes no assumptions on the method used to generate or deploy resources, the only requirement is that you provide
a ResourceManager that can find them. Note that it is also possible to subclass QueryParserResourceProvider
or implement Lucene.Net.Util.IResourceProvider directly to provide resources from any source.
QueryParserResourceProvider
The default Lucene.Net.Util.IResourceProvider implementation for the QueryParserMessages class. This class can be set in the SetResourceProvider(IResourceProvider) method and supplied with one or more ResourceManager instances that can override the default query parser messages (generally, they are exception messages).
Alternatively, this class may be overridden to provide either a custom FallbackResourceManager or to alter the fallback logic in either GetString(string, CultureInfo?) or GetObject(string, CultureInfo?). The performance of this class may be improved significantly by specifying the ResourceManager that a specific resource can be found in rather than attempting all of them.