I have two entity classes(simplified) as follows:
Code:
@Entity
@Table(name="categories")
public class Categories{
@DocumentId
String id;
@Field(index=TOKENIZED, store=store.YES)
String name;
.....
}
@Entity
@Table(name="subcategories")
public class Subcategories{
@DocumentId
String id;
@Field(index=TOKENIZED, store=store.YES)
String name;
}
How do I restrict search to name which exists only in Categories or Subcategories?
I am building MultiFieldQueryParser and if I pass just "name" it returns matching objects from both Categories and SubCategories. I have tried categories.name, Categories.name to restrict the search only within Categories, but it does not return anything for the same search string.
Am I doing anything wrong? I appreciate any help.
Thanks.[/code]