FlexSearch / FlexLucene

IKVM Build scripts
Apache License 2.0
16 stars 5 forks source link

Is FlexLucene compatible with Mono and Linux ? #7

Open devheroo opened 8 years ago

devheroo commented 8 years ago

First of all , Thanks so much for this awesome work that brought the latest of Lucene to the .NET platform. I have known Lucene for many years and always felt disappointed for not being able to use its latest version in my .NET projects.

I read that FlexSearch runs only on windows but what about FlexLucene? Is FlexLucene compatible with Mono and Linux ? if not, can you please explain why and what issues prevent FlexLucene from running on Mono ?

I wrote a small application to test it under Mono/Linux, this application has two parts: 1- part one, use in memory index (RAMDirectory) : indexing and search works fine! and that is amazing. 2- part two, use file system index (SimpleFSDirectory or NIOFSDirectory) : indexing fails with "System.TypeInitializationException" at the Open method: FlexLucene.Store.Directory index = SimpleFSDirectory.Open(java.nio.file.Paths.get(ixdir));

I have seen the last issue of the GermanAnalyzer that generated a similar exception (System.TypeInitializationException) and I hope it is possible to have a solution also for the exception I am getting.

here is the full exception information:

System.TypeInitializationException: The type initializer for 'FlexLucene.Store.MMapDirectory' threw an exception. ---> java.lang.InternalError: uncaught exception ---> System.NotImplementedException: The method or operation is not implemented.
  at System.Reflection.MemberInfo.get_Module () [0x00017] in <filename unknown>:0
  at System.Reflection.Emit.FieldBuilder.get_Module () [0x00000] in <filename unknown>:0
  at IKVM.Internal.FieldWrapper.ResolveField () [0x0000f] in <filename unknown>:0
  at NativeInvokerBytecodeGenerator.emitStaticInvoke (java.lang.invoke.MemberName member, java.lang.invoke.Name name) [0x00194] in <filename unknown>:0
  at NativeInvokerBytecodeGenerator.generateCustomizedCodeBytes () [0x00161] in <filename unknown>:0
  at NativeInvokerBytecodeGenerator.generateCustomizedCode (java.lang.invoke.LambdaForm form, java.lang.invoke.MethodType invokerType) [0x00037] in <filename unknown>:0
  at java.lang.invoke.LambdaForm.compileToBytecode () [0x00020] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at java.lang.invoke.MethodHandleStatics.uncaughtException (System.Exception ) [0x00038] in <filename unknown>:0
  at java.lang.invoke.MethodHandleImpl.makeGuardWithTest (java.lang.invoke.MethodHandle , java.lang.invoke.MethodHandle , java.lang.invoke.MethodHandle ) [0x00075] in <filename unknown>:0
  at java.lang.invoke.MethodHandles.guardWithTest (java.lang.invoke.MethodHandle test, java.lang.invoke.MethodHandle target, java.lang.invoke.MethodHandle fallback) [0x000d4] in <filename unknown>:0
  at FlexLucene.Store.MMapDirectory.UnmapHackImpl () [0x00124] in <filename unknown>:0
  at FlexLucene.Store.MMapDirectory+__<>Anon3.run () [0x00000] in <filename unknown>:0
  at java.security.AccessController.doPrivileged (System.Object , java.security.AccessControlContext , ikvm.internal.CallerID ) [0x00029] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at FlexLucene.Store.FSDirectory.Open (Path p, FlexLucene.Store.LockFactory lf) [0x00007] in <filename unknown>:0
  at FlexLucene.Store.FSDirectory.Open (Path p) [0x00006] in <filename unknown>:0
  at FlexLuceneApp.LuceneTest.TestFlexLuceneFS (System.String[] args) [0x00017] in /home/master/workspace/mono/FlexLuceneApp/FlexLuceneApp/LuceneTest.cs:30
  at FlexLuceneApp.MainClass.Main (System.String[] args) [0x0000c] in /home/master/workspace/mono/FlexLuceneApp/FlexLuceneApp/Program.cs:13
vladnega commented 8 years ago

Hi @devheroo. Thank you for your interest!

We haven't really thought about running FlexLucene on Mono/Linux.

After a quick glance at the exception message, it seems like the issue might be because of IKVM. (FlexLucene depends heavily on IKVM, as I'm sure you know). Others had problems with this as well:

https://sourceforge.net/p/ikvm/mailman/message/34911315/

I will investigate some more to see if there's something we can do about it.

devheroo commented 8 years ago

Thanks a lot @vladnega , I appreciate getting back to me on this. It will be really amazing to get FlexLucene working on Mono and I will be glad to assist in any possible way. I will follow the IKVM mailing list and learn more about this.