Custom analyzer for RavenDB - ravendb

I need some info on developing a custom analyzer for RavenDB.
I'm in the stage of setting up the DLL, the custom analyzer will be pretty simple as I need just a small modification of the StandardAnalyzer.
I found this page:
http://www.tomdupont.net/2013/05/alphanumeric-lucene-analyzer-for-ravendb.html
Obviously it doesn't work out of the box :-)
1) Where do I have to put the custom analyzer DLL? In my hard disk the path of Raven.Database.dll is "D:\ravendb\Server", so I put the Raven.Extensions.AlphanumericAnalyzer.dll of the example above in the new folder "D:\ravendb\Server\Analyzers".
2) Ho can I check if the DLL is recognized and loaded by RavenDB server (after the service has been reloaded)?
3) How can I reference the new analyzer at the bottom of index page settings of web GUI of RavenDB? I read about fully qualified type name, using IlSpy I found something like "Raven.Extensions.AlphanumericAnalyzer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null".
4) Should the solution be compiled in x85 or AnyCPU? Debug or Release?
5) The link talks about a custom analyzer for RavenDB 2.5, any difference with RavenDB 3.5?
Thanks a lot.

1) That seems to be the right path, given the default config.
2) Create an index that uses that analyzer. If it works, it was loaded.
3) The easiest way to get the right value is to call typeof(YourAnalyze).AssemblyQualifiedName
4) AnyCPU, Release
5) Not for your needs, it should be the same.

Related

Prevent ASP.NET Core application from using appsettings.json file

I would like to tell to ASP.NET Core application that even if appsettings.json file is there - ignore it.
I would prefer to write this as a comment but I'm still a newby here so I cannot ask questions.
I would like to understand what is the specific problem you are facing right now.
In general the usage or not of the appsettings file depends on your application.
For example, if you create a Web API using default .NET template, you can see that the appsettings file only has some configuration for logging, which you can even delete and nothing happens. You can run the application anyway and it works.
So, coming back to your question, it dependes on what your application is doing. If you have a specific library that needs to read configuration from this file, then you'll need to research how to change that default value.
If you are reading from that file, then you could set value in code instead. (this is obvious but since you didn't provide any more context I don't know what you are struggling with)

MVC 4 Bundling URL instead of files

I think my title says everyting, I want to bundle a set of action urls which return JavaScriptResult instead of physical files, is this somehow possible?
Best regards
I do not think you will have to wait for new release of ASP.NET MVC.
WebOptimization library is a separate project - that is developed somehow independently.
I am not 100% sure if this is something that you have been looking for but there is a support for virtual path providers now:
http://codebetter.com/howarddierking/2012/10/20/new-web-optimization-pre-release-package-on-nuget/
Can you explain your scenario a bit more? My guess is the answer is no, if what yare looking for is whether bundling will effectively drill down and fetch the contents of urls and then minify/bundle them.
We are planning on adding virtual path provider support in the next release which might enable this scenario as you would then be able to write a VPP that could serve up the JavaScriptResult to the bundling system.
Does that make sense?

Load App.Config at runtime

I am creating a test project using IBM's Rational Functional Tester(RFT) tool(we are using the VB version of it and it only supports till .net 3.5).In this project I am making all database queries using the entity framework.The problem is entity framework retrieves "Metadata", "Connection String" etc from the App.Config file,and RFT won't let me add a App.Config to the project(I guess it is designed that way -- I googled adding an App.Config file to an rft project and came up with nothing), and the Entity Framework requires you to have the app.config file at the entry point.I was building the string to pass to entity framework in code, but my boss really does not like that.
So looking at my options I think any of the below 2 solutions should suffice(or if you have a better solution please advise).
Is their any way to load an App.Config during run-time.
Is their any way to add an App.Config to an RFT project(should
really be my first question).
If you guys could help me with this it will be great.
Thanks in advance.
After a lot of research i found you can load the config file at runtime by using,
ExeConfigurationFileMap map = new ExeConfigurationFileMap();
map.ExeConfigFilename = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Assembly.GetExecutingAssembly().ManifestModule.Name + ".config");
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
var configValue = config.ConnectionStrings.ConnectionStrings["refrenceNameinConfigfile"].ConnectionString;
just make sure your App.config is within the folder where your exe file is running

System.IO.Directory.Getfiles Silverlight 4 is not working

I'm using Silverlight 4 OOB & elevated trust.
I need to get all the filenames on specific directory & populate an object List(Of String)
The compiler throws an error "Method not found" on .Getfiles() method.
Dim files() As String = System.IO.Directory.Getfiles(Path) 'this line is failing..
Help!
The GetFiles is marked as "Security Critical" and therefore cannot be used from your code.
You will want to use the EnumerateFiles method instead. GetFiles is sooo .NET 1.0, EnumerateFiles is much slicker, even in the full framework you'd want avoid this older Array returning API if you can.
As far as I know you cannot directly access the whole hard drive using Silverlight OOB.
Quoting from Silverlight site:
When running in a trusted environment, you can access only files in
user folders, specifically the MyDocuments, MyMusic, MyPictures, and
MyVideos folders. Although this makes sense from a security point of
view, it’s limiting. You want to enable the user to drag their data
from any location. As it stands right now, if you try to drop a file
from a location other than stated above, Silverlight will throw a
security error.
Please refer to this link for details on how to work with the hard drive using Silverlight OOB:
http://www.silverlight.net/learn/overview/out-of-browser-applications/advanced-silverlight-out-of-browser-introduction#Exercise3

EntLib 5 Wrap Handler Message Localization

I have been asked, at very short notice of course, to implement exception logging to the Windows Application event Log in one of our products (vb.Net, framework 3.5, WinForms) using EntLib 5. In and of itself this is fine - I can get that working. However, this is for a client who wants messages in Chinese. Certain parts of the app have language resource files and I found a couple of sentences in my MS EntLib Developers Guide book which suggested that I could use an external resource to provide a localised 'friendly' message in a wrap handler within the Exception Handling Block.
Unfortunately there was no mention of how to actually achieve this but it seemed straightforward enough. I added a new resource to a resx file which lives at the project level for the project which is common to all areas of the application and re-built to project so that the satellite assemblies were built. I then specified the name of the resource in the 'Message Resource Name' field within the EntLib configuration console. the problem arises when I try and specify the 'Message Resource Type'.
I clicked on the search button and found the satellite assembly I needed, but it did not get added to the list of loaded assemblies and therefore I couldn't select it. The problem is that none of the places where I've seen this feature mentioned actually demonstrate how to get it working so I'm not sure where I'm going wrong. The search for the assembly will only let me select a dll or exe so I assume I am supposed to reference the satellite assembly somehow but how do I do this if it won't add it to the list of loaded assemblies?
One point to note is that we have a main executable which then calls numerous class libraries to load areas of functionality as required, and the config file we use throughout is the one which belongs to the main executable. Is it the case that you can only use satellite assemblies which are related to the assembly that the config file belongs to?
I haven't yet fully utilized this feature yet but just something to check, are you using the fully qualified name of the assembly?
EDIT: A potentially applicable link - http://entlib.codeplex.com/discussions/67460