Multiple search results
Permalink
Recently for some reason my search block is displaying the same result twice.
ie. Search for Administration
It displays the Administration page twice in the search results.
Anyone have an idea to help resolve my issue? Thank you in advance if you can.
ie. Search for Administration
It displays the Administration page twice in the search results.
Anyone have an idea to help resolve my issue? Thank you in advance if you can.
try deleting the sitemap.xml file
Unfortunately that didn't work. I saw in the forums something about getting into the data base and reseting a completely separate issue of the search eternally running. Haven't tried that one since it's not directly related to mine.
Any other suggestions? Thanks again in advance.
Any other suggestions? Thanks again in advance.
No suggestions I'm afraid, but just wanted to confirm that one of my clients had the same issue. He took a screenshot a showed it to me, but when I went to the site to have a look it was all back to normal.
Strange!
Strange!
Problem resolved - don't know what happened but it seems to resolve its self ? :)
This is a permissions bug. It doesn't happen when you're logged out; it happens when you're logged in in a group that has greater permissions (like Administrator, etc..)
Try opening concrete/libraries/database_indexed_search.php and replacing this function:
public function filterByKeywords($kw) {
$db = Loader::db();
$kw = $db->quote($kw);
$this->addToQuery("select PageSearchIndex.*, match(cName, cDescription, content) against ({$kw} in boolean mode) as score from PageSearchIndex inner join Pages on PageSearchIndex.cID = Pages.cID inner join CollectionSearchIndexAttributes on PageSearchIndex.cID = CollectionSearchIndexAttributes.cID");
Loader::model('attribute/categories/collection');
$keys = CollectionAttributeKey::getSearchableIndexedList();
$attribsStr = '';
foreach ($keys as $ak) {
$attribsStr=' OR ak_' . $ak->getAttributeKeyHandle() . ' like '.$kw.' ';
}
$this->filter(false, "(match(cName, cDescription, content) against ({$kw} in boolean mode) {$attribsStr})");
}
With this:
public function filterByKeywords($keywords) {
$db = Loader::db();
$kw = $db->quote($keywords);
$this->addToQuery("select distinct PageSearchIndex.cID, PageSearchIndex.content, PageSearchIndex.cName, PageSearchIndex.cDescription, PageSearchIndex.cPath, PageSearchIndex.cDatePublic, match(cName, cDescription, content) against ({$kw} in boolean mode) as score from PageSearchIndex inner join Pages on PageSearchIndex.cID = Pages.cID inner join CollectionSearchIndexAttributes on PageSearchIndex.cID = CollectionSearchIndexAttributes.cID");
Loader::model('attribute/categories/collection');
$keys = CollectionAttributeKey::getSearchableIndexedList();
$attribsStr = '';
foreach ($keys as $ak) {
$cnt = $ak->getController();
$attribsStr.=' OR ' . $cnt->searchKeywords($keywords);
}
$this->filter(false, "(match(cName, cDescription, content) against ({$kw} in boolean mode) {$attribsStr})");
}
-- Note the distinct cID.
Try opening concrete/libraries/database_indexed_search.php and replacing this function:
public function filterByKeywords($kw) {
$db = Loader::db();
$kw = $db->quote($kw);
$this->addToQuery("select PageSearchIndex.*, match(cName, cDescription, content) against ({$kw} in boolean mode) as score from PageSearchIndex inner join Pages on PageSearchIndex.cID = Pages.cID inner join CollectionSearchIndexAttributes on PageSearchIndex.cID = CollectionSearchIndexAttributes.cID");
Loader::model('attribute/categories/collection');
$keys = CollectionAttributeKey::getSearchableIndexedList();
$attribsStr = '';
foreach ($keys as $ak) {
$attribsStr=' OR ak_' . $ak->getAttributeKeyHandle() . ' like '.$kw.' ';
}
$this->filter(false, "(match(cName, cDescription, content) against ({$kw} in boolean mode) {$attribsStr})");
}
With this:
public function filterByKeywords($keywords) {
$db = Loader::db();
$kw = $db->quote($keywords);
$this->addToQuery("select distinct PageSearchIndex.cID, PageSearchIndex.content, PageSearchIndex.cName, PageSearchIndex.cDescription, PageSearchIndex.cPath, PageSearchIndex.cDatePublic, match(cName, cDescription, content) against ({$kw} in boolean mode) as score from PageSearchIndex inner join Pages on PageSearchIndex.cID = Pages.cID inner join CollectionSearchIndexAttributes on PageSearchIndex.cID = CollectionSearchIndexAttributes.cID");
Loader::model('attribute/categories/collection');
$keys = CollectionAttributeKey::getSearchableIndexedList();
$attribsStr = '';
foreach ($keys as $ak) {
$cnt = $ak->getController();
$attribsStr.=' OR ' . $cnt->searchKeywords($keywords);
}
$this->filter(false, "(match(cName, cDescription, content) against ({$kw} in boolean mode) {$attribsStr})");
}
-- Note the distinct cID.
AWESOME - Thank you for the info!