lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shad Storhaug <s...@shadstorhaug.com>
Subject RE: lucene.search.highlight conversion
Date Wed, 03 May 2017 17:19:18 GMT
Matt,

This is one of the interesting things with working on a Java port such as this - you pick
up a few things about .NET that you didn't already know.

String interning is an optimization that minimizes the memory needed to store strings. It
essentially ensures that if you have 2 or more strings with the same value, they only appear
once in RAM. https://msdn.microsoft.com/en-us/library/system.string.intern(v=vs.110).aspx

As for why they are used in .NET but not Java, I suspect that someone saw an opportunity to
make an optimization by using interning. That said, you might want to review to make sure
it is doing what it is supposed to do.

FYI - Highlighter was ported several months ago on pull request #191 (https://github.com/apache/lucenenet/pull/191),
which was merged to master last week. If you need to use it, it is available now on our CI
feed (https://www.myget.org/gallery/lucene-net-ci). Pending a release vote, we will have a
beta up on NuGet in a couple of days.

That said, we still have some missing pieces - see our contributing page for the current status:
https://github.com/apache/lucenenet/blob/master/CONTRIBUTING.md. If you want to help out we
certainly would appreciate it. The most pressing issues are some flakey tests and fixing documentation
comments - and of course we could use some help getting it setup to generate the documentation.
But there are also some modules to port and command-line tools to build into executables,
if you are interested.

Thanks,
Shad Storhaug (NightOwl888)


-----Original Message-----
From: Matt Diehl [mailto:matt@etnstudio.com.INVALID] 
Sent: Wednesday, May 3, 2017 11:19 PM
To: dev@lucenenet.apache.org
Subject: lucene.search.highlight conversion

Hi,

Has anyone converted this yet? I pulled from the latest checked-in branch and was working
on getting this compiling. Most of the conversion is adding/removing "()" and changing 'count'
to 'size' and removing 'get' from function names. I've not worked with this before, and I
have a question.

if (fieldName != null)
{
    fieldName = StringHelper.Intern(fieldName); }

I keep seeing the the above call. It seems like some sort of sanity-cleaning funciton that
takes a string and returns a string. It doesn't really exist though (and doesn't exist in
Java Lucene from my searching). Can someone help me?

Thanks,
Matt
Mime
View raw message