本文整理汇总了Java中org.hibernate.search.jpa.FullTextEntityManager.flush方法的典型用法代码示例。如果您正苦于以下问题:Java FullTextEntityManager.flush方法的具体用法?Java FullTextEntityManager.flush怎么用?Java FullTextEntityManager.flush使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.search.jpa.FullTextEntityManager
的用法示例。
在下文中一共展示了FullTextEntityManager.flush方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test
import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void test() {
final String testValue = "test";
assertThat(entityWithFullTextRepository.findCount(findByValue(testValue))).isEqualTo(0);
EntityWithFullText entityWithFullText = new EntityWithFullText();
entityWithFullText.setValue(testValue);
entityWithFullText = entityWithFullTextRepository.save(entityWithFullText);
FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
fullTextEntityManager.index(entityWithFullText);
fullTextEntityManager.flushToIndexes();
fullTextEntityManager.flush();
assertThat(entityWithFullTextRepository.find(findByValue(testValue))).containsExactly(entityWithFullText);
}
示例2: test
import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void test() {
final String testValue = "test";
assertThat(entityWithMultipleFullTextRepository.findCount(findByValue(testValue))).isEqualTo(0);
EntityWithMultipleFullText entityWithMultipleFullText = new EntityWithMultipleFullText();
entityWithMultipleFullText.setValue1(testValue);
entityWithMultipleFullText.setValue2("abcdef");
entityWithMultipleFullText = entityWithMultipleFullTextRepository.save(entityWithMultipleFullText);
FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
fullTextEntityManager.index(entityWithMultipleFullText);
fullTextEntityManager.flushToIndexes();
fullTextEntityManager.flush();
assertThat(entityWithMultipleFullTextRepository.find(findByValue(testValue))).containsExactly(entityWithMultipleFullText);
}
示例3: deep_test
import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void deep_test() {
final String testValue = "test";
assertThat(entityWithMultipleFullTextRepository.findCount(findByDeepValue(testValue))).isEqualTo(0);
EntityWithMultipleFullText entityWithMultipleFullText = new EntityWithMultipleFullText();
entityWithMultipleFullText.setValue1("abcdef");
EntityWithFullText entityWithFullText = new EntityWithFullText();
entityWithFullText.setValue(testValue);
entityWithMultipleFullText.setEntityWithFullText(entityWithFullText);
entityWithMultipleFullText = entityWithMultipleFullTextRepository.save(entityWithMultipleFullText);
FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
fullTextEntityManager.index(entityWithMultipleFullText);
fullTextEntityManager.flushToIndexes();
fullTextEntityManager.flush();
assertThat(entityWithMultipleFullTextRepository.find(findByDeepValue(testValue))).containsExactly(entityWithMultipleFullText);
}
示例4: test
import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void test() {
final Integer testValue = 1995;
assertThat(entityWithFullTextIntegerRepository.findCount(findByValue(testValue))).isEqualTo(0);
EntityWithFullTextInteger entityWithFullTextInteger = new EntityWithFullTextInteger();
entityWithFullTextInteger.setValue(testValue);
entityWithFullTextInteger = entityWithFullTextIntegerRepository.save(entityWithFullTextInteger);
EntityWithFullTextInteger another = new EntityWithFullTextInteger();
another.setValue(1994);
entityWithFullTextIntegerRepository.save(another);
FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
fullTextEntityManager.index(entityWithFullTextInteger);
fullTextEntityManager.flushToIndexes();
fullTextEntityManager.flush();
assertThat(entityWithFullTextIntegerRepository.find(findByValue(testValue))).containsExactly(entityWithFullTextInteger);
}
示例5: test_similarity
import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void test_similarity() {
assertThat(entityWithFullTextRepository.findCount(findByValueWithSimilarity("tast"))).isEqualTo(0);
EntityWithFullText entityWithFullText = new EntityWithFullText();
entityWithFullText.setValue("test");
entityWithFullText = entityWithFullTextRepository.save(entityWithFullText);
FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
fullTextEntityManager.index(entityWithFullText);
fullTextEntityManager.flushToIndexes();
fullTextEntityManager.flush();
assertThat(entityWithFullTextRepository.find(findByValueWithSimilarity("tast"))).containsExactly(entityWithFullText);
}
示例6: testAnd
import org.hibernate.search.jpa.FullTextEntityManager; //导入方法依赖的package包/类
@Test
public void testAnd() {
final String testValue1 = "abc";
final String testValue2 = "def";
assertThat(entityWithMultipleFullTextRepository.findCount(findByValue(testValue1, testValue2))).isEqualTo(0);
EntityWithMultipleFullText entityWithMultipleFullText = new EntityWithMultipleFullText();
entityWithMultipleFullText.setValue1(testValue1);
entityWithMultipleFullText.setValue2(testValue2);
entityWithMultipleFullText = entityWithMultipleFullTextRepository.save(entityWithMultipleFullText);
EntityWithMultipleFullText entityWithMultipleFullText2 = new EntityWithMultipleFullText();
entityWithMultipleFullText2.setValue1(testValue1);
entityWithMultipleFullText2.setValue2("toto");
entityWithMultipleFullText2 = entityWithMultipleFullTextRepository.save(entityWithMultipleFullText2);
EntityWithMultipleFullText entityWithMultipleFullText3 = new EntityWithMultipleFullText();
entityWithMultipleFullText3.setValue1("toto");
entityWithMultipleFullText3.setValue2(testValue2);
entityWithMultipleFullText3 = entityWithMultipleFullTextRepository.save(entityWithMultipleFullText3);
FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
fullTextEntityManager.index(entityWithMultipleFullText);
fullTextEntityManager.index(entityWithMultipleFullText2);
fullTextEntityManager.index(entityWithMultipleFullText3);
fullTextEntityManager.flushToIndexes();
fullTextEntityManager.flush();
assertThat(entityWithMultipleFullTextRepository.find(findByValue(testValue1, testValue2))).containsExactly(entityWithMultipleFullText);
}