I am using Hibernate search 3.3 to search a Lucene index. I have a filter I need to use on a certain field, but also make it TOKENIZED for full text search. What I have found is that when I have the field set to UN_TOKENIZED, the filter works and full text search doesn't, and when I have it set to TOKENIZED, full text search works and the filter doesn't.
POJO
Code:
@Field(name = "owningOrganization", index = Index.UN_TOKENIZED, store = Store.YES)
@FieldBridge(impl = OrganizationNameFieldBridge.class)
public Organization getOwningOrganization()
{
Filter
Code:
@Factory
public Filter getFilter()
{
BooleanQuery query = new BooleanQuery();
Term orgTerm = new Term("owningOrganization", userOrganization);
Term activeTerm = new Term("currentStateIsActive", "1");
query.add(new TermQuery(orgTerm), Occur.SHOULD);
query.add(new TermQuery(activeTerm), Occur.SHOULD);
return new CachingWrapperFilter(new QueryWrapperFilter(query));
}
When I enter search terms of
Code:
owningOrganization:"This is the exact value of an organization"
I get no results, but the filter works as desired. And opposite when I switch it to TOKENIZED.
Any suggestions?