List of usage examples for org.apache.lucene.search IndexSearcher setDefaultQueryCachingPolicy
public static void setDefaultQueryCachingPolicy(QueryCachingPolicy defaultQueryCachingPolicy)
From source file:org.hibernate.search.test.filter.deprecated.FilterTest.java
License:LGPL
@Override @Before//w ww . ja va 2 s . co m public void setUp() throws Exception { super.setUp(); cachingPolicy = IndexSearcher.getDefaultQueryCachingPolicy(); IndexSearcher.setDefaultQueryCachingPolicy(QueryCachingPolicy.ALWAYS_CACHE); createData(); query = createQuery(); fullTextSession = Search.getFullTextSession(openSession()); fullTextSession.getTransaction().begin(); }
From source file:org.hibernate.search.test.filter.deprecated.FilterTest.java
License:LGPL
@Override @After//from ww w . j a v a 2 s. c o m public void tearDown() throws Exception { try { fullTextSession.getTransaction().commit(); fullTextSession.close(); } finally { // Reset the caching policy to its original state if (cachingPolicy != null) { IndexSearcher.setDefaultQueryCachingPolicy(cachingPolicy); } } super.tearDown(); }