I am using django and haystack for a search (obviously) and I dont want it including inherited objects. For example:
lets say I have model Person and model Employee(which inherits from Person). When an Employee object is added, it also creates a Person object. Person’s dont have to be Employees though.
So I want to search all Person and Employee records, but exclude Person objects that are also Employees
I hope this makes sense,
Cheers
You can add a
is_employeefield to your SearchIndex class for Person model.After that you can use this field to exclude the persons that are also Employees.
You can also replace this field with a more generic field
person_typeif you have more than one person types.