Uploaded image for project: 'Hibernate OGM'
  1. OGM-1091

Clarify what needs to be done to do searches in the getting started guide

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.0.Final
    • Fix Version/s: 5.1.0.Final
    • Component/s: documentation
    • Labels:
      None

      Description

      By following the getting started guide I can create a very simple app that creates entities and finds them by ID.

      What doesn't work is if I just try to search for them all. Note that I converted employee entity to use OGM, but its based on your guide.

      Caused by: org.hibernate.search.exception.SearchException: HSEARCH000278: Can't build query for type 'org.swarmic.examples.jparest.Employee' which is neither indexed nor has any indexed sub-types.
      	at org.hibernate.search.query.dsl.impl.ConnectedQueryContextBuilder$HSearchEntityContext.<init>(ConnectedQueryContextBuilder.java:51)
      	at org.hibernate.search.query.dsl.impl.ConnectedQueryContextBuilder.forEntity(ConnectedQueryContextBuilder.java:37)
      	at org.hibernate.hql.lucene.internal.builder.predicate.LucenePredicateFactory.getRootPredicate(LucenePredicateFactory.java:77)
      	at org.hibernate.hql.ast.spi.SingleEntityQueryBuilder.setEntityType(SingleEntityQueryBuilder.java:76)
      	at org.hibernate.hql.ast.spi.SingleEntityQueryRendererDelegate.registerPersisterSpace(SingleEntityQueryRendererDelegate.java:117)
      	at org.hibernate.hql.ast.render.QueryRenderer.entityName(QueryRenderer.java:12331)
      	at org.hibernate.hql.ast.render.QueryRenderer.persisterSpaceRoot(QueryRenderer.java:3063)
      	at org.hibernate.hql.ast.render.QueryRenderer.persisterSpace(QueryRenderer.java:2955)
      	at org.hibernate.hql.ast.render.QueryRenderer.persisterSpaces(QueryRenderer.java:2892)
      	at org.hibernate.hql.ast.render.QueryRenderer.fromClause(QueryRenderer.java:2802)
      	at org.hibernate.hql.ast.render.QueryRenderer.selectFrom(QueryRenderer.java:2703)
      	at org.hibernate.hql.ast.render.QueryRenderer.querySpec(QueryRenderer.java:2181)
      	at org.hibernate.hql.ast.render.QueryRenderer.queryExpression(QueryRenderer.java:2105)
      	at org.hibernate.hql.ast.render.QueryRenderer.queryStatement(QueryRenderer.java:1744)
      	at org.hibernate.hql.ast.render.QueryRenderer.queryStatementSet(QueryRenderer.java:1657)
      	at org.hibernate.hql.ast.render.QueryRenderer.statement(QueryRenderer.java:653)
      	at org.hibernate.hql.ast.spi.QueryRendererProcessor.process(QueryRendererProcessor.java:51)
      	at org.hibernate.hql.QueryParser.parseQuery(QueryParser.java:82)
      	at org.hibernate.ogm.query.impl.FullTextSearchQueryTranslator.getLuceneQuery(FullTextSearchQueryTranslator.java:100)
      	at org.hibernate.ogm.query.impl.FullTextSearchQueryTranslator.list(FullTextSearchQueryTranslator.java:75)
      	at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
      	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326)
      	at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)
      	at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
      	at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)
      	at org.swarmic.examples.jparest.EmployeeService.getAll(EmployeeService.java:41)
      	at org.swarmic.examples.jparest.EmployeeService$Proxy$_$$_WeldClientProxy.getAll(Unknown Source)
      	at org.swarmic.examples.jparest.EmployeeRest.get(EmployeeRest.java:44)
      	at org.swarmic.examples.jparest.EmployeeRest$Proxy$_$$_WeldSubclass.get(Unknown Source)
      	at org.swarmic.examples.jparest.EmployeeRest$Proxy$_$$_WeldClientProxy.get(Unknown Source)
      	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.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)
      	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296)
      	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250)
      	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237)
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
      	... 27 more
      

      I suspect there's additional setup required, but it would be great if the getting started guide explained this since doing arbitrary searches is a general use case.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: