In my database, I have fields named 'Author 1', 'Author 2', 'Author 3', 'Other Authors', 'Contributors', 'Editors', and 'Translators'. When I perform a search from one of these fields in the 'Advanced Search' section, I want the search to be conducted across all these fields and return the relevant results. Is this possible?
multi field search at Advanced Search
-
- User
- Posts: 20
When I enter a search term in the 'Author 1' field in the advanced search Panel, I want the system to simultaneously search through all the following fields: 'Author 2', 'Author 3', 'Other Authors', 'Contributors', 'Editors', and 'Translators'. For example, if I search for "John Doe", I want the search to return all records where "John Doe" appears in any of these fields.
I use this code but it doesn't work
function Recordset_SearchValidated() {
if ($this->isSearch()) {
$searchTerm = trim($this->author1->AdvancedSearch->SearchValue);
if ($searchTerm != "") {
$this->author1->AdvancedSearch->SearchValue = $searchTerm;
$this->author2->AdvancedSearch->SearchValue = $searchTerm;
$this->author3->AdvancedSearch->SearchValue = $searchTerm;
$this->other_authors->AdvancedSearch->SearchValue = $searchTerm;
$this->editors->AdvancedSearch->SearchValue = $searchTerm;
$this->translators->AdvancedSearch->SearchValue = $searchTerm;
$this->contributors->AdvancedSearch->SearchValue = $searchTerm;
}
}
}