The ConnectedMultiFieldsPhraseQueryBuilder uses a HashMap to store Terms and positions (Line: 73). The Term query expects a List of sorted terms. Since a HashMap is not sorted in every case, the Phrase query may results in an error (Line 160). Consider using a TreeMap or order the Map before adding the Terms to the query. Exception: Caused by: java.lang.IllegalArgumentException: Positions must be added in order. Got position=2 while previous position was 16 at org.apache.lucene.search.PhraseQuery.add(PhraseQuery.java:625) at org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsPhraseQueryBuilder.createQuery(ConnectedMultiFieldsPhraseQueryBuilder.java:160) at org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsPhraseQueryBuilder.createQuery(ConnectedMultiFieldsPhraseQueryBuilder.java:53) at com.andrae_ag.margay.search.Search.searchMemory(Search.java:57) at com.andrae_ag.margay.search.Search$$FastClassBySpringCGLIB$$7c5c7fd6.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) ... 62 more |