Index creation is not happening properly


#1

Hi I am using hibernate search for 1 lakh record in oracle database. It is taking a lot of time but finally giving me empty result. I am below code to create index.

getFullTextEntityManager().createIndexer().typesToIndexInParallel(4).batchSizeToLoadObjects(50)
.cacheMode(CacheMode.NORMAL).threadsToLoadObjects(20).startAndWait();


#2

I guess that today I learned “100,000” is “1 lakh” in India :slight_smile:

I’m afraid you didn’t give enough information for us to help you.

  • Which version of Hibernate Search and Hibernate ORM are you using?
  • Do you use the Lucene integation or the Elasticsearch integration? If Elasticsearch, which version?
  • Which query do you execute that gives you “empty result”?
  • What do you logs say, do you have any exception to report?
  • If you enable logging at the INFO level for the org.hibernate.search.batchindexing.impl.SimpleIndexingProgressMonitor class before mass indexing, what appears in the logs?
  • Do you have any EntityIndexingInterceptor set up that could prevent some entities from being indexed?

#3

Hi Yrodiere,

Thanks for you quick response.
Please find my below

  1. I am using hibernate-search-orm (version - 5.10.4.Final) and hibernate-core(version - 5.3.7.Final)
  2. I am using lucene search and querying like below -

org.apache.lucene.search.Query luceneQuery = qb.keyword().wildcard().onFields(ColumnList).matching(searchString)
.createQuery();
3. I have not enabled the log and also not using interceptor.

*Index is not getting properly created on the path configured in the application.


#4

You’re likely just using a query that doesn’t return any result. Just use qb.all().createQuery() (and don’t forget to limit the number of results).
It will return all documents, proving that indexing worked fine.

As to why your query doesn’t work… Note that wildcard queries are case-sensitive, which might explain why you’re not getting any result. You will find many answers on the specific topic of wildcard queries vs “edge-ngrams” analyzers on stackoverflow, and some in this forum. Have a look and try the suggestions.