lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NightOwl888 <...@git.apache.org>
Subject [GitHub] lucenenet issue #191: Migrating Lucene.Net to .NET Core
Date Thu, 24 Nov 2016 22:40:48 GMT
Github user NightOwl888 commented on the issue:

    https://github.com/apache/lucenenet/pull/191
  
    > @NightOwl888 seems like the code for Highlighter is too obsolete. It uses classes,
which since 4.8 don't exist anymore (e.g. TermEnum) and needs MemoryIndex to be ported to
full .NET. Shall I wait till porting 4.8 version to .NET Framework is complete?
    
    @Metamorphus 
    
    I am not sure I understand your question exactly, but since this is a port of version
4.8.0 we should port all of it from [lucene-solr 4.8.0](https://github.com/apache/lucene-solr/tree/releases/lucene-solr/4.8.0)
(or no later than 4.8.1) to be compatible. As great as it would be to be able to get the features
of Lucene 6.x, it is not very likely we will be able to make the pieces fit if we try that.

    
    Once we reach the 4.8.0 milestone and have a stable release, my hope is that work can
begin on [upgrading it to a more recent version of Lucene](https://github.com/apache/lucenenet/pull/174#issuecomment-251614795),
rather than doing another port from scratch (which for 4.8.0 has taken 2 years to get to its
current state of 95% of the way to release, and is the reason why Lucene.Net is now lagging
so far behind Lucene). For now, 4.8.0 is shiny and new in the .Net world, and is a huge improvement
over Lucene.Net 3.0.3. Your contribution of Highlighter will make the 4.8.0 release a reality
sooner.
    
    Lucene 4.8.0 Highlighter is available here: https://github.com/apache/lucene-solr/tree/releases/lucene-solr/4.8.0/lucene/highlighter.
To make things easier, you may wish to clone the [lucene-solr repo](https://github.com/apache/lucene-solr/)
to your local machine and then use
    
    ```
    git checkout tags/releases/lucene-solr/4.8.0
    ```
    
    to view the Java code at the 4.8.0 release.
    
    Then, you can clone the https://github.com/apache/lucenenet repository (if you have not
already done so), make a branch to work on (`git checkout -b highlighter`), add 2 projects
to the solution named  `Lucene.Net.Highlighter` and `Lucene.Net.Tests.Highlighter`, and begin
porting. Note that we are keeping similar namespace names despite the fact that they may differ
from project names that they reside in.
    
    It is not necessary to have much knowledge of Java, but be prepared to do a Google search
for every piece that you are unsure about (something like `java HashMap equivalent c#`). If
you can't get an answer on Google, try to find another piece of code in lucene-solr that references
the same type and see how the conversion was handled in Lucene.Net.  It is usually simpler
to do this up front than to put something in that you are totally unsure of and then have
to work out why the tests are failing later, but also note that you won't be able to be 100%
sure it is right until the tests are passing (and even then there may still be some doubt).

    
    > Heads up - be aware that the Substring overload with 2 parameters in Java works differently
than .NET (it should be translated from `Substring(start, end)` to `Substring(start, end -
start)`).
    
    Anyway, once you are comparing the same version between Lucene and Lucene.Net, things
should go smoother. The `MemoryIndex` class is in the `Lucene.Net.Memory` project. To my knowledge,
there is no `TermEnum` type, but there is one named `TermsEnum` in the `Lucene.Net` (core)
project in the `Lucene.Net.Index` namespace, which is used by 4 types in Highlighter 4.8.0.
    
    Let me know if you need further assistance, and do be sure to also confirm whether you
will be porting Highlighter so we don't have any duplicate efforts or lags because we are
waiting for something that isn't being worked on. Also, you should probably join the [dev
mailing list](https://lucenenet.apache.org/community.html) and continue this conversation
there.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message