Search returning all items
Search returning all items
Hello All,
I have a SimpleSearch control in the header of my site pages.
If I enter a phrase (e.g. "knife") the control redirects me to "~/Search.aspx?k=knife".
But I see all the items in my database ("Displaying items 1-15 of 600").
The "Narrow or Expand" results sidebar seems to be correct in that the proper categories (containing knives) are listed and the proper product count is shown.
Clicking on an item in the Narrow or Expand box brings up the proper limited list of "knives".
How do I get the SearchPage to render the proper (reduced) list of items on initial load?
Thanks,
-tomas
I have a SimpleSearch control in the header of my site pages.
If I enter a phrase (e.g. "knife") the control redirects me to "~/Search.aspx?k=knife".
But I see all the items in my database ("Displaying items 1-15 of 600").
The "Narrow or Expand" results sidebar seems to be correct in that the proper categories (containing knives) are listed and the proper product count is shown.
Clicking on an item in the Narrow or Expand box brings up the proper limited list of "knives".
How do I get the SearchPage to render the proper (reduced) list of items on initial load?
Thanks,
-tomas
Re: Search returning all items
It may be helpful
viewtopic.php?f=42&t=7690
viewtopic.php?f=42&t=7690
Re: Search returning all items
Here is a workaround to run the CategorySearchSidebar from ConLib/Custom folder properly. I have attached the Modified files. Once you move the CategorySearchSidebar to CobLib/Custom folder you need to adjust its class name from ConLib_CategorySearchSidebar to ConLib_Custom_CategorySearchSidebar in both
ascx and cs files. I have attached the ConLib/Custom files in attachment so you can check them to adjust you version of custom folder.
You need to install the attached files in same order in which they are in attachment means the ICategorySearchSidebar.cs will go to App_Code and SearchPage.ascx and SearchPage.ascx.cs will go in ConLib/Custom folder. In fact SearchPage.ascx.cs file is modified so it should also go to the custom folder. You can then make use both search page and side bar from custom folder.
ascx and cs files. I have attached the ConLib/Custom files in attachment so you can check them to adjust you version of custom folder.
You need to install the attached files in same order in which they are in attachment means the ICategorySearchSidebar.cs will go to App_Code and SearchPage.ascx and SearchPage.ascx.cs will go in ConLib/Custom folder. In fact SearchPage.ascx.cs file is modified so it should also go to the custom folder. You can then make use both search page and side bar from custom folder.
Re: Search returning all items
Note that this has already been fixed in 7.0.2.
It is always good to upgrade to latest version.
There are a lot of other fixes and improvements
http://help.ablecommerce.com/upgrades/a ... _7.0.2.htm
It is always good to upgrade to latest version.
There are a lot of other fixes and improvements
http://help.ablecommerce.com/upgrades/a ... _7.0.2.htm
Re: Search returning all items
We are running 7.0.2 already.
I'm re-installing the updates to make sure I didn't miss a step.
Hopefully that will fix it.
Thanks,
-tomas
I'm re-installing the updates to make sure I didn't miss a step.
Hopefully that will fix it.
Thanks,
-tomas
sohaib wrote:Note that this has already been fixed in 7.0.2.
It is always good to upgrade to latest version.
There are a lot of other fixes and improvements
http://help.ablecommerce.com/upgrades/a ... _7.0.2.htm
Re: Search returning all items
OK. I have verified that we are running 7.0.2
We still have the problem.
1. We have a SimpleSearch control on the Header of the page.
2. If I enter "book" in the box, I am redirected to "~/search.aspx?k=book" and all my products are returned.
3. The "CategorySearch" right panel correctly displays the proper product count. and If I click the links there, the proper number of products are displayed in the search results panel.
Any suggestion on what else could be wrong? 7.0.2 doesn't seem to be the fix.
-tomas
We still have the problem.
1. We have a SimpleSearch control on the Header of the page.
2. If I enter "book" in the box, I am redirected to "~/search.aspx?k=book" and all my products are returned.
3. The "CategorySearch" right panel correctly displays the proper product count. and If I click the links there, the proper number of products are displayed in the search results panel.
Any suggestion on what else could be wrong? 7.0.2 doesn't seem to be the fix.
-tomas
sohaib wrote:Note that this has already been fixed in 7.0.2.
It is always good to upgrade to latest version.
There are a lot of other fixes and improvements
http://help.ablecommerce.com/upgrades/a ... _7.0.2.htm
Re: Search returning all items
We're having the same problem
We only want a simply search in the left hand nav, but whenever you type something in it returns all items
Any ideas?
We only want a simply search in the left hand nav, but whenever you type something in it returns all items

Any ideas?
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Search returning all items
This is working OK on two sites that were upgrades to 7.0.2 upgrade with the search in the left nav.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: Search returning all items
Anyone got any ideas? - im upgraded to 7.0.2 but still anything entered into the simplesearch returns ALL itemsindustry wrote:We're having the same problem
We only want a simply search in the left hand nav, but whenever you type something in it returns all items![]()
Any ideas?
Here is the ascx.cs code - anything wrong here?
Code: Select all
using System;
using CommerceBuilder.Utility;
public partial class ConLib_SimpleSearch : System.Web.UI.UserControl
{
protected void Page_Init()
{
string handleEnterScript = "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('"
+ SearchButton.UniqueID + "').click();return false;}} else {return true}; ";
SearchPhrase.Attributes.Add("onkeydown", handleEnterScript);
}
protected void SearchButton_Click(object sender, EventArgs e)
{
string safeSearchPhrase = StringHelper.StripHtml(SearchPhrase.Text);
if (!string.IsNullOrEmpty(safeSearchPhrase))
Response.Redirect("~/Search.aspx?k=" + Server.UrlEncode(safeSearchPhrase));
Response.Redirect("~/Search.aspx");
}
}
Re: Search returning all items
I think there seems to be something wrong with search page showing search results. How did you customized the search page it self. Did you hide the CategorySearchSidebar? I guess search page lsits all products if it doesn't found CategorySearchSidebar available on page. Try following fix instead of removingindustry wrote:Anyone got any ideas? - im upgraded to 7.0.2 but still anything entered into the simplesearch returns ALL itemsindustry wrote:We're having the same problem
We only want a simply search in the left hand nav, but whenever you type something in it returns all items![]()
Any ideas?
Here is the ascx.cs code - anything wrong here?Code: Select all
using System; using CommerceBuilder.Utility; public partial class ConLib_SimpleSearch : System.Web.UI.UserControl { protected void Page_Init() { string handleEnterScript = "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + SearchButton.UniqueID + "').click();return false;}} else {return true}; "; SearchPhrase.Attributes.Add("onkeydown", handleEnterScript); } protected void SearchButton_Click(object sender, EventArgs e) { string safeSearchPhrase = StringHelper.StripHtml(SearchPhrase.Text); if (!string.IsNullOrEmpty(safeSearchPhrase)) Response.Redirect("~/Search.aspx?k=" + Server.UrlEncode(safeSearchPhrase)); Response.Redirect("~/Search.aspx"); } }
Code: Select all
[[ConLib:CategorySearchSidebar]]
Code: Select all
[[ConLib:CategorySearchSidebar Visible="false"]]
Re: Search returning all items
Thank you, that works
As an follow on from this though, is it possible to use the simplesearch to search on the full description as well as the product title, as currently it only searches on title
Regards,
Ian

As an follow on from this though, is it possible to use the simplesearch to search on the full description as well as the product title, as currently it only searches on title
Regards,
Ian
Re: Search returning all items
Hmm try following trick I think it will work. Edit ConLib/SearchPage.ascx.cs file and locate following line of code in it
and make it look like
Code: Select all
ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
Code: Select all
//ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
ProductList.DataSource = ProductDataSource.AdvancedSearch(_Keywords, this.CategoryId, _ManufacturerId, true, true, true, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
- igavemybest
- Captain (CAPT)
- Posts: 388
- Joined: Sun Apr 06, 2008 5:47 pm
Re: Search returning all items
Since the page just sits there, and the user thinks the search didnt work (they just dont know it is in the process because it takes a second), does anyone have a solution as to easily add the AC7 modal popup with the thinking timer until the search results page loads?
Re: Search returning all items
Mazhar, I went ahead and tried to implement this code in my SearchPage.ascx.cs exactly as you statedmazhar wrote:Hmm try following trick I think it will work. Edit ConLib/SearchPage.ascx.cs file and locate following line of code in itand make it look likeCode: Select all
ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
Code: Select all
//ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue); ProductList.DataSource = ProductDataSource.AdvancedSearch(_Keywords, this.CategoryId, _ManufacturerId, true, true, true, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
Code: Select all
//ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
ProductList.DataSource = ProductDataSource.AdvancedSearch(_Keywords, this.CategoryId, _ManufacturerId, true, true, true, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
When I look at the page, I can usually find a term matching the search in the description, leading me to believe it's working, however when I try to be more exact with text in a description, for example instead of "game" I use "video game" (both are in the description) then the search finds nothing, whereas just "game" finds the product.
Also, the exact text in the description is "... video games", but searching "game" works and "games" does not.