We're updating the issue view to help you get more done. 

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

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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 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.

Environment

None

Status

Assignee

Davide D'Alto

Reporter

JohnA

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

5.0.0.Final

Priority

Major