在hibernate搜索的初始化过程中,我似乎遗漏了一些东西。
我的mysql数据库表包含一些现有行,这些行似乎不作为结果的一部分返回。
启动应用程序后通过应用程序添加的任何新行似乎都会在hibernate搜索中返回。
我需要返回所有行,包括表中已经存在的行,需要添加什么才能得到它?
这是我用来查询的代码部分。
// get the full text entity manager
FullTextEntityManager fullTextEntityManager=Search.getFullTextEntityManager(entityManager);
//
我正在尝试使用Hibernate搜索版本5.5.0进行全文查询。full (我已经尝试过最新版本,但不能工作,可能是因为我使用的是旧版本的Hibernate (5.0.12) )。
我想要得到的最终结果如下:
Display at the top of the list the result that matches on the description field with the following logic:
(Let' assume a user is searching "Milk")
-Results having the word at
我正在使用"Hibernate search“在数据库中索引我的实体。一切都很好,lucene引擎工作得很好!
现在,我尝试成功地检测到查询中是否存在无效字段。在本例中,我找到了org.hibernate.search.SearchException,并显示了一条消息"Unable to find field for...“我正在尝试对排序字段执行相同的操作,但是Lucene引擎接受任何字符串,而不会触发异常。
如何触发异常或检测到无效的排序字段?
我使用Hibernate搜索和Spring。对于Hibernate搜索,我没有任何特殊的配置。它只显示了在应用程序启动时的警告。如何指定hibernate.search.lucene_version?
我的SearchService类(使用Hibernate搜索的唯一地方):
@Service
public class SearchService {
private FullTextEntityManager fullTextEntityManager;
private QueryBuilder queryBuilder;
@Autowired
public
我正在通过Hibernate search和Lucene实现全文搜索功能。搜索看起来是这样的,并且运行得很好。我的问题是,我们的实体类大多非常大,所以提供100个结果的搜索花费了太长的时间,因为查询找到的实体非常耗时。
打开表单时,我使用HQL查询加载了最后20个已编辑的实体,这也花费了我很长的时间,因此我创建了一个实体,其中只包含需要在结果列表中显示的字段和实际实体的ID。只有当用户单击某个结果以查看其详细信息时,才会加载实际实体。这将查询时间加快到原始时间的1/100或更少。
有没有办法以同样的方式加速Hibernate搜索查询,所以我搜索一个实体,但只查询对象的ID,而不是整个实体?
E
我想实现一个搜索查询,该查询在数据库中搜索文本。但是我总是得到一个空的结果,尽管文本出现在一个DataSet中。
public List<Object> getSearchVorgangResult( final int mandantId, final String searchValue, final List<Integer> projektIds,
final Field field,
对于在使用hibernate-search执行查询时执行多个约束的可能性,我有一个问题。
@Indexed
public class Contact{
//ommited fields
@IndexEmbedded
private List<Communication> communications;
//setters - getters
}
以及相关的类
@Indexed
public class Communication{
@Field(analyze = Analyze.YES, s
最近,我加入了一个使用Hibernate搜索的项目。 我怀疑我们的应用程序中有一个小故障,由于在两个地方使用了FullTextEntityManager,导致其他后台作业忽略了新索引的数据: 1)从UI中搜索目标数据时,我们在第一次搜索请求时使用MassIndexer对数据进行索引,所有后续的搜索请求都不会导致重新索引: private final AtomicBoolean initialized = new AtomicBoolean(false);
...
public FullTextQuery buildTransactionSearchQuery(SearchRequestDTO
我有一个定义如下的实体。如果使用save(),Hibernate不会为新创建的实体创建新的索引。更新/修改现有实体运行良好,符合预期。
我用的是弹簧靴2。
@Entity(name = "shipment")
@Indexed
data class Shipment(
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) val id: Long = -1,
@JoinColumn(name = "user") @ManyToOne() var user: User?,
我正在运行一个使用hibernate search在系统中查找人员的应用程序。我在JBoss AS 7.1.1上运行它,该应用程序基于Seam 3、Weld和JSF2.1。它工作得很顺利,但是在一些更高的负载之后,使用FullTextEntityManager的页面加载起来非常慢。在某些时刻,整个应用程序变慢了。
所以我突然想到,也许我对Hibernate搜索的使用不正确。我正在使用一个启动单例来索引数据库:
@Singleton
@Startup
public class Initializer implements Serializable {
private static fi
当使用以下枚举字段使用Hibernate搜索时:
public class UserSkill {
@Enumerated
@Field
private UserSkillLevel level; // <- this is the field we're using on the ranged query
}
public class User { // <- this is the root class
@IndexedEmbedded
private Set<UserSkill> skills = new Hash
我必须对字段进行编程配置,以便使用Hibernate搜索进行索引。
在下面的场景中,使用indexEmbedded()会导致“字段未找到错误”。
@Entity
public class AT {
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "ARRM_IDE", nullable = false)
private A arr;
private Date dateType;
(and other fields)
}
@Entity
public class A {