是否可以创建一个@RooSolrSearchable对象而不是JPA实体?

时间:2022-09-11 11:54:34

Is it possible to create an object that is @RooSolrSearchable without being a JPA entity?

是否可以创建一个@RooSolrSearchable对象而不是JPA实体?

We have an object model made up of 5-6 layers of composition. We need to search on some text fields in the lowest level of the object model, but we need to filter by the upper layers. Our thought was to create a DTO specifically for Solr, that way we can run filterqueries on the ID fields, and fuzzy matches on the text fields.

我们有一个由5-6层组合物组成的物体模型。我们需要搜索对象模型最低级别的一些文本字段,但我们需要按上层进行过滤。我们的想法是专门为Solr创建一个DTO,这样我们就可以在ID字段上运行filterqueries,在文本字段上运行模糊匹配。

Roo expects a little different model... if you annotate an object as @RooSolrSearchable, it expects it to be a JPA entity. We just want search, and the benefits of using search (Aspect generation, etc) without it being an JPA entity. We could of course, do this the manual way with Spring and SolrJ... but we'd rather have Roo do the hard work.

Roo期望一个不同的模型......如果你将一个对象注释为@RooSolrSearchable,它期望它是一个JPA实体。我们只想要搜索,以及使用搜索(Aspect生成等)而不是JPA实体的好处。当然,我们可以用Spring和SolrJ手动方式做到这一点......但我们宁愿让Roo付出艰苦的努力。

What's the best way for us to proceed?

什么是我们继续前进的最佳方式?

1 个解决方案

#1


0  

Ok, so there really isn't a way to do this that I can find. We ended up using the normal Solr-Spring integration (which isn't all that bad).

好的,所以我找不到真正无法做到这一点的方法。我们最终使用了正常的Solr-Spring集成(这并不是那么糟糕)。

#1


0  

Ok, so there really isn't a way to do this that I can find. We ended up using the normal Solr-Spring integration (which isn't all that bad).

好的,所以我找不到真正无法做到这一点的方法。我们最终使用了正常的Solr-Spring集成(这并不是那么糟糕)。