lucene

org.apache.lucene.Version ClassNotFoundException during elasticsearch

匆匆过客 提交于 2020-01-06 12:25:51
问题 I am using elasticsearch-rest-high-level client 6.4.0 in my application, I have added all the dependant jars from lucene as listed in maven. This is the error I am getting [org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: org/apache/lucene/util/Version] with root cause java.lang.ClassNotFoundException: org.apache.lucene.util.Version I was using jersey1 before and my web.xml was like this <servlet> <servlet-name>Restful App</servlet-name> <servlet-class>com.sun

NPE while creating org.apache.lucene.search.Query

无人久伴 提交于 2020-01-06 05:43:47
问题 I wanted to make Full text Search via my Spring Boot application with the help of Hibernate Search. But I faced with such a problem: NPE while creating org.apache.lucene.search.Query . Here is my code @Repository public class HibernateSearch { @PersistenceContext private EntityManager entityManager; @Transactional public List<Manual> fulltextSearching(String keyword){ FullTextEntityManager fullTextEntityManager = org.hibernate.search.jpa.Search.getFullTextEntityManager(entityManager);

Solr remove ranking or modify ranking feature

佐手、 提交于 2020-01-06 05:36:09
问题 I want to optimise my Solr engine. I don't want ranked results. I just want all docs which match my query is there any way I can remove it . So that retrieving data improves ? 回答1: There is no need to remove relevancy ranking to achieve what you want. By setting the rows parameter to the same number as the numfound you will retrieve all documents matching your query. http://url-to-some-server/solr/select?q=somequery&rows=200 if you want the documents sorted in another way than by relevance,

Lucene phrase match with a wildcard at the end

本秂侑毒 提交于 2020-01-05 12:11:32
问题 I'm trying to make a predictive text search that allows a user to start typing, and results from their text come through as results E.g. with "ca" they can get "cat in the hat", "my calculus is cool" "cat dog mouse" However, if a person continues to type with spaces, I want the whole phrase to be considered as one term E.g. "cat i" should find "cat in the hat" but NOT "[cat] dog mouse" nor "my calculus [i]s cool" This is my current code, however it does not seem to be working as I'd hoped:

Relevancy boosting very slow in Solr

最后都变了- 提交于 2020-01-05 09:34:06
问题 I have a Solr index with about 2.5M items in it and I am trying to use an ExternalFileField to boost relevancy. Unfortunately, it's VERY slow when I try to do this, despite it being a beefy machine and Solr having lots of memory available. In the external file I have contents like: 747501=3.8294805903e-07 747500=3.8294805903e-07 1718770=4.03292174724e-07 1534562=3.8294805903e-07 1956010=3.8294805903e-07 747509=3.8294805903e-07 747508=3.8294805903e-07 1718772=3.8294805903e-07 1391385=3

Lucene 2.4.0 Range Query is not working as expected

守給你的承諾、 提交于 2020-01-05 09:02:54
问题 Below are the indexed fields with value: EffectiveDate="1970" ExpirationDate="2035" Code to create index and seach: public class IndexTest{ static Analyzer analyzer = new StandardAnalyzer(); static IndexSearcher isearcher; @BeforeClass public static void createIndex() throws CorruptIndexException, LockObtainFailedException, IOException{ Store s = Field.Store.YES; Store ds = Field.Store.YES; Index IA = Field.Index.ANALYZED; Index INA = Field.Index.NOT_ANALYZED; IndexWriter iwriter = new

How to include maven-based project into my non-maven project

烂漫一生 提交于 2020-01-05 08:56:40
问题 I have a non-maven app engine project. I need to include the following library/project into it: https://github.com/UltimaPhoenix/luceneappengine. Without using maven at all, how do I make this work? I need step by step details. I have been trying and my code will not even compile. I am using eclipse. Looking at the pom.xml I have figured that I need to download luceneappengine, which I did at http://search.maven.org/#search%7Cga%7C1%7Cluceneappengine. Do I need any other jars? 回答1: First of

How to get DocValue by document ID in Lucene 7+?

送分小仙女□ 提交于 2020-01-05 08:01:17
问题 I'm adding a DocValue to a document with doc.add(new BinaryDocValuesField("foo",new BytesRef("bar"))); To retrieve that value for a specific document with ID docId , I call DocValues.getBinary(reader,"foo").get(docId).utf8ToString(); The get function in BinaryDocValues is supported up to Lucene 6.6, but for Lucene 7.0 and up it does not seem to be available anymore. So, how do I get the DocValue by document ID in Lucene 7+ (without having to iterate over BinaryDocValues / DocIdSetIterator ,

How to get DocValue by document ID in Lucene 7+?

寵の児 提交于 2020-01-05 08:01:12
问题 I'm adding a DocValue to a document with doc.add(new BinaryDocValuesField("foo",new BytesRef("bar"))); To retrieve that value for a specific document with ID docId , I call DocValues.getBinary(reader,"foo").get(docId).utf8ToString(); The get function in BinaryDocValues is supported up to Lucene 6.6, but for Lucene 7.0 and up it does not seem to be available anymore. So, how do I get the DocValue by document ID in Lucene 7+ (without having to iterate over BinaryDocValues / DocIdSetIterator ,

Words normalization using RDD

荒凉一梦 提交于 2020-01-05 07:02:16
问题 Maybe this question is a little bit strange... But I'll try to ask it. Everyone, who wrote applications with using Lucene API, seen something like this: public static String removeStopWordsAndGetNorm(String text, String[] stopWords, Normalizer normalizer) throws IOException { TokenStream tokenStream = new ClassicTokenizer(Version.LUCENE_44, new StringReader(text)); tokenStream = new StopFilter(Version.LUCENE_44, tokenStream, StopFilter.makeStopSet(Version.LUCENE_44, stopWords, true));