I have a FullTextQuery against the following classes
Since I'm always only interested in reading only one
comment with a post, I don't use @IndexedEmbedded on the Post.comments field. Adding it would needlessly grow the Post index. In stead I use a classbridge for this.
I do want to query comments by Post.
FullTextSession fts = Search
QueryBuilder qb = fts.getSearchFactory().buildQueryBuilder()
Query q = qb.bool().must(
FullTextQuery ftq = fts.createFullTextQuery(q, Comment.class)
However, I get this error:Unable to find field post in Comment
Adding a classbridge to add the missing field, doesn't help because up to HSearch 4.0, fields added in classbridges are invisible to HSearch. Not even sure, if this has changed when it comes to querying on fields in stead of projecting.
Adding a fieldbridge on the field also doesn't seem to help.
Any ideas on how to accomplish the select in HSearch 3.4?