-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Filters not working
PostPosted: Fri Jul 11, 2014 5:57 am 
Newbie

Joined: Wed Apr 02, 2014 8:04 am
Posts: 6
Hi!

I wanted to use filters for refining my searchresults, but i always get empty results. The command "query.getQueryString()" is empty, too.
I just did everything, as it is shown in defferent examples:
1.) Annotating the entity-class with
@FullTextFilterDefs({
@FullTextFilterDef(name = "myFilter", impl = MyFilterFactory.class)
})

2.) Implementing the Factory class:

public class MyFilterFactory {
private long id;

@Factory
public Filter getFilter() {
Term term1 = new Term("test.id", String.valueOf(id));
TermQuery query1 = new TermQuery(term1);
return new CachingWrapperFilter(new QueryWrapperFilter(query1));
}

@Key
public FilterKey getKey() {
StandardFilterKey key = new StandardFilterKey();
key.addParameter(id);
return key;
}

public void setId(long id) {
this.id = id;
}

3.) enabling search:
hibQuery.enableFullTextFilter("myFilter").setParameter("id", 123);


I don't know what i'm doing wrong. Is there something i have forgotten?

Please help me!

Thanks in advance!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.