org.hibernate.search.exception.SearchException: HSEARCH000302: Cannot execute query 'name:emmanuel', as targeted entity type 'org.hibernate.search.test.engine.worker.Employee' is indexed through a non directory-based backend

Hibernate JIRA | Sanne Grinovero | 1 year ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0
  2. 0
  3. 0

    When using custom numeric field bridges on a sortable field, querying with a sort on this field will always fail with the following stacktrace: {code} org.hibernate.search.exception.SearchException: HSEARCH000307: Sort type INT is not compatible with UNKNOWN type of field 'favoriteTerritory'. at org.hibernate.search.query.engine.impl.AbstractHSQuery.validateNumericEncodingType(AbstractHSQuery.java:430) at org.hibernate.search.query.engine.impl.AbstractHSQuery.validateNumericSortField(AbstractHSQuery.java:412) at org.hibernate.search.query.engine.impl.AbstractHSQuery.validateSortField(AbstractHSQuery.java:399) at org.hibernate.search.query.engine.impl.AbstractHSQuery.validateCommonSortField(AbstractHSQuery.java:307) at org.hibernate.search.query.engine.impl.AbstractHSQuery.validateSortField(AbstractHSQuery.java:283) at org.hibernate.search.query.engine.impl.AbstractHSQuery.validateSortFields(AbstractHSQuery.java:270) at org.hibernate.search.query.engine.impl.LuceneHSQuery.buildSearcher(LuceneHSQuery.java:481) at org.hibernate.search.query.engine.impl.LuceneHSQuery.buildSearcher(LuceneHSQuery.java:380) at org.hibernate.search.query.engine.impl.LuceneHSQuery.queryEntityInfos(LuceneHSQuery.java:138) at org.hibernate.search.query.hibernate.impl.FullTextQueryImpl.list(FullTextQueryImpl.java:202) at org.hibernate.search.test.query.sorting.SortOnFieldsFromCustomBridgeTest.testNumericCustomFieldLevelBridge(SortOnFieldsFromCustomBridgeTest.java:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.hibernate.testing.junit4.FailureExpectedHandler.evaluate(FailureExpectedHandler.java:41) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.hibernate.testing.junit4.BeforeClassCallbackHandler.evaluate(BeforeClassCallbackHandler.java:26) at org.hibernate.testing.junit4.AfterClassCallbackHandler.evaluate(AfterClassCallbackHandler.java:25) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) {code} Pull request coming, with test case and fix.

    Hibernate JIRA | 8 months ago | Yoann Rodière
    org.hibernate.search.exception.SearchException: HSEARCH000307: Sort type INT is not compatible with UNKNOWN type of field 'favoriteTerritory'.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.search.exception.SearchException

      HSEARCH000302: Cannot execute query 'name:emmanuel', as targeted entity type 'org.hibernate.search.test.engine.worker.Employee' is indexed through a non directory-based backend

      at org.hibernate.search.query.engine.impl.LuceneHSQuery.getIndexManagers()
    2. Hibernate Search Engine
      LuceneHSQuery.queryEntityInfos
      1. org.hibernate.search.query.engine.impl.LuceneHSQuery.getIndexManagers(LuceneHSQuery.java:595)
      2. org.hibernate.search.query.engine.impl.LuceneHSQuery.buildSearcher(LuceneHSQuery.java:401)
      3. org.hibernate.search.query.engine.impl.LuceneHSQuery.buildSearcher(LuceneHSQuery.java:363)
      4. org.hibernate.search.query.engine.impl.LuceneHSQuery.queryEntityInfos(LuceneHSQuery.java:126)
      4 frames
    3. Hibernate Search ORM
      FullTextQueryImpl.list
      1. org.hibernate.search.query.hibernate.impl.FullTextQueryImpl.list(FullTextQueryImpl.java:202)
      1 frame
    4. org.hibernate.search
      WorkerTestCase$Work.run
      1. org.hibernate.search.test.engine.worker.WorkerTestCase$Work.run(WorkerTestCase.java:109)
      1 frame
    5. Java RT
      ThreadPoolExecutor$Worker.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      2 frames