close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Search is not filtering out results

Thread began 9/08/2014 10:39 am by dDog | Last modified 9/08/2014 1:09 pm by Jason Byrnes | 1757 views | 15 replies |

dDog

Search is not filtering out results

Hello Webassist! I'm hoping that you can help me solve a mystery.

We have two ecommerce sites which share one database between them. We differentiate products for our site using a ProductExclusiveFire column. "0" (our site) or "2" (both sites). We filtered the results in our recordset using WHERE (ProductExclusiveFire = 0 OR ProductExclusiveFire = 2)

php:
"SELECT DISTINCT products.* FROM products LEFT OUTER JOIN productcategoriesjoin ON JoinProduct = ProductID WHERE (ProductDeactivate = 0) AND (ProductExclusiveFire = 0 OR ProductExclusiveFire = 2)"



We also filtered our search results to say "AND NOT ProductExclusiveFire = 1"

php:
$WADbSearch1->addComparison("ProductExclusiveFire","1","AND NOT","=",1);

  $WADbSearch1->addComparison("ProductExclusiveBM","1","AND NOT","=",1);
  $WADbSearch1->addComparison("ProductDeactivate","1","AND NOT","=",1);
  $WADbSearch1->addComparisonFromList("JoinCategory","S_ProductCategoryID","AND","=",1);
  $WADbSearch1->addComparisonFromEdit("ProductName","S_ProductName","AND","Includes",0);
  $WADbSearch1->addComparisonFromEdit("ProductSKU","S_ProductName","OR","Includes",0);
  $WADbSearch1->addComparisonFromEdit("ProductManufacturer","S_ProductName","OR","Includes",0);
  $WADbSearch1->addComparisonFromEdit("ProductKeywords","S_ProductName","OR","Includes",0);
  $WADbSearch1->addComparisonFromEdit("ProductShortDesc","S_ProductName","OR","Includes",0);



After all of this filtering, still, when a user types a name that matches products (ProductExclusiveFire=1) the results still appear with the rest.

When a user selects a category, no ExclusiveFire products appear, but when typing a search term, ExclusiveFire products appear. Here is an example of search results which bring up both normal products and ExclusiveFire products (denoted by the flame icon).

My question is this : What would cause "fire exclusive products" appear in the search results despite these efforts to filter them out? Attached is the Results.php page. Any assistance is greatly appreciated.

- Benjamin

Sign in to reply to this post

Jason ByrnesWebAssist

hard coded conditions like this should be added in the Data Assist search, they should be added in the recordset where clause:

WHERE (ProductDeactivate = 0) AND (ProductExclusiveFire = 0 OR ProductExclusiveFire = 2) AND (ProductExclusiveFire <> 1) AND (ProductExclusiveBM <> 1) AND (ProductDeactivate <> 1)

Sign in to reply to this post

dDog

Thanks for the quick reply! I modified the recordset to

php:
SELECT DISTINCT products.* FROM products LEFT OUTER JOIN productcategoriesjoin ON JoinProduct = ProductID WHERE (ProductDeactivate = 0) AND (ProductExclusiveFire = 0 OR ProductExclusiveFire = 2) AND (ProductExclusiveFire <> 1) AND (ProductExclusiveBM <> 1) AND (ProductDeactivate <> 1)"



I uploaded to the live site and tested the live page, but the FireExclusive products still show. Do I need to modify the Data Assist Search parameters also?

Sign in to reply to this post

Jason ByrnesWebAssist

  but the FireExclusive products still show  



which specific products are you referring to?

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

dDog

See PM.

Sign in to reply to this post

Jason ByrnesWebAssist

still need to know which specific products are you referring to?

Sign in to reply to this post

Jason ByrnesWebAssist

give an example of one of the products that are showing in thew results page that should not be showing please.

Sign in to reply to this post

dDog

See PM

Sign in to reply to this post

Jason ByrnesWebAssist

2 things:

1) edit the data assist search server behavior, and remove the conditions for the ProductExclusiveFire, ProductExclusiveBM, and ProductDeactivate columns that where added to the recordset SQL

2) you have 5 criteria all set to use the S_ProductName form element, instead of using 5 criteria, use 1 and set it to be a key word, using a key word criteria type, you can select multiple columns to filter in the column list

Sign in to reply to this post

dDog

This post has been deleted.

loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...