Unable to find TermRangeQuery in hibernate-search 6 - lucene

I am not able to find below class in hibernate-search 6
import org.apache.lucene.search.TermRangeQuery;
is there any similar class available?

This is an Apache Lucene class, not a Hibernate Search class. And this class still exists in the version of Lucene (8) used by Hibernate Search 6, so I don't understand what your problem is exactly.
In any case... you should probably use the Hibernate Search DSL, and the range predicate.

Related

Is specific Lucene classes are intended to be consumed by applications?

I'm new to the Apache Lucene library. I'd like to directly consume a class in this library called: LevenshteinDistance to calculated similarity search between strings. Would that be correct for my own application to directly consume it, or should I go thru the Lucene api?
Just using that single class is totally ok, but if you just need that you should take the soure code of that class, remove unneded Lucene dependencies, and use it. Lucene is a huge thing and you don't want to have it in your project if you only needs to compute a string distance.
One thing: In the source code for LevenshteinDistance.java there's a comment mentioning that the code was taken from Apache Commons "StringUtils" clas. Maybe you should just add that. It's here: https://commons.apache.org/proper/commons-lang/

lucene chararrayset not found

I am using the below solution for removing stopwords while applying stanford NLP.
https://github.com/jconwell/coreNlp
This project has dependency on old version of Lucene ( 3.6.2 )
I need to migrate this code to lucene 5.5.2 in order to utilise latestfeatures of lucene.
While I try to fix the below file ,
https://github.com/jconwell/coreNlp/blob/master/src/main/java/intoxicant/analytics/coreNlp/StopwordAnnotator.java
I observed that the below classes are no longer available in lucene 5.5.2
import org.apache.lucene.analysis.CharArraySet;
import org.apache.lucene.analysis.StopAnalyzer;
I could not find information on the alternate classes for these from Lucene documentation.
In case if anybody is aware on the right classes to be used from the latest lucene release , kindly revert back.
Below are the classes to be used from lucene 5.5.2
import org.apache.lucene.analysis.util.CharArraySet;
import org.apache.lucene.analysis.core.StopAnalyzer;

Noise Removal using Lucene 4.8

I couldn't find any examples of removing stop-words from text using Lucene 4.8. Can you please advise me on how to use the classes StopFilter and StopAnalyzer classes to achieve this.
Two of three StandardAnalyzer constructors allow specifying stopwords; just use any of those. This analyzer uses StopFilter underneath, you don't have to do anything extra.

missing packages in lucene 4.0 snapshot

anybody knows why there is no QueryParser, nor IndexWriter.MaxFieldLength(25000) and some more in Lucene 4.0 Snapshot?
I'm having hard time to port the code to this newer version, though I'm following the code as given here: http://search-lucene.com/jd/lucene/overview-summary.html
How do I find the missing packages, and how do I get them? As the snapshop jar doesn't contain all the features..
thanks
Lucene has been re-architectured, and some classes which used to be in the core module are now in submodules. You will now find the QueryParser stuff in the queryparser submodule. Similarly, lots of useful analyzers, tokenizers and tokenfilters have been moved to the analysis submodule.
Regarding IndexWriter, the maximum field length option has been deprecated, it is now recommended to wrap an analyzer with LimitTokenCountAnalyzer (in the analysis submodule) instead.

Using the same libraries of different versions

I have 2 libs: owls.jar and envy.jar. They depends on lib jena.jar but two differnet, incompitables versions. envy using old version - jena.jar, owls new - jena2.jar
I want to use them togever at web application running on glassfish-3.0.1. I`m using IDEA 11 for deploying my web app.
I have directory tree like this:
webapp/web-inf/lib/envy.jar
webapp/web-inf/lib/owls.jar
webapp/lib/envy/jena.jar
webapp/lib/owls/jena2.jar
I add into manifest.mf of envy and owls libs class-path like this: ../../lib/envy/jena.jar
I use -verbose:class option and I always get loaded class from jena.jar.If I`m using or not using envy.jar at all, I always get loaded class from jena.jar. Only if I delete envy.jar then classes loads from jena2.jar
Is there are any way to use both of this libs?
The only way to use 2 different version of the same class is to laod them through 2 different classloaders. That is you have to load owls.jar__and __jena.jar with one class loader and envy.jar and jena2.jar with another. This solution has its own pitfalls, you should probably right custom code that will be able to use another classloader when it's necessary, maybe you will end up with writing your own class loader.
As far as I know there is no built in solution for such situation. May be, it is easier to use older version of one the jar's above that can support the same version of jena.jar This is much easier solution.