Hi again,
when I try to search all my indexed entities (which are in total 100.000) I got an "Too many parameters" exception as you can see here:
Code:
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2536)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at org.hibernate.search.query.hibernate.impl.CriteriaObjectsInitializer.initializeObjects(CriteriaObjectsInitializer.java:107)
at org.hibernate.search.query.hibernate.impl.QueryLoader.executeLoad(QueryLoader.java:84)
at org.hibernate.search.query.hibernate.impl.AbstractLoader.load(AbstractLoader.java:72)
at org.hibernate.search.query.hibernate.impl.FullTextQueryImpl.list(FullTextQueryImpl.java:208)
at org.hibernate.search.jpa.impl.FullTextQueryImpl.getResultList(FullTextQueryImpl.java:147)
...
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:196)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1454)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:388)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:338)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)
...
The SQL statement:
Code:
select ... from My_Elements_Table where (ID in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?...................................................) or ID in(?,?,......) .... ) // a lot of question marks
My Query is build like this:
Code:
FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(getEntityManager());
SearchFactory searchFactory = fullTextEntityManager.getSearchFactory();
QueryBuilder queryBuilder = searchFactory.buildQueryBuilder().forEntity(My_Elements.class).get();
FullTextQuery fullTextQuery = fullTextEntityManager.createFullTextQuery(queryBuilder.all().createQuery(), My_Elements.class);
List<My_Elements> myElements = fullTextQuery.getResultList();
Is there a problem when searching with hibernate search on such a large amount of data? What can I do to retrieve all results (except paging)?
Regards, jacquipre.