Hi,
I'm performing a full text search of multiple classes in one query:
Code:
FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(luceneQuery, Class1.class, Class2.class);
fullTextQuery.enableFullTextFilter("Class1.available");
fullTextQuery.enableFullTextFilter("Class2.visible");
fullTextQuery.list();
Each class defines a filter that should only apply to it and not any other classes. The problem I'm having is that the results of both classes are being filtered by both filters.
Does anyone know a way to work around this while still only doing one query? Would something like the following work?
Code:
fullTextQuery.enableFullTextFilter("Class1.available").setParameter('type', Class1.class);
If so, how would I modify the following filter factory to take that parameter and use it to only filter out instances of that type?
Code:
public static class NotDeletedFilter extends QueryWrapperFilter {
public NotDeletedFilter() {
super(new TermQuery(new Term("deleted", "false")));
}
}
thanks