Contributions

Features (Category Index)
Search: 

Corrections to Search Algorithm

Complete rewrite of the search algorithm in advanced_search_result.php (around line 203). Frankly, it was broken.

Regardless of which condition (AND / OR) was set as the default concatenation operator.

In the stock algorithm, if ONE search word appeared in the products_name, and ANOTHER search word appeared in products_model, then the product met the criteria. However, the logical expectation is that the words appear in the SAME fields(s).

In other words, for the criteria to be met, the condition must be satisfied in whole within the context of a single data attribute. For example: In the existing algorithm, if the word fragment 'CAT' appeared anywhere in the description, and the number '5' appeared in the model, then a search for 'CAT 5' would be satisfied.. but not the intention.

What is intended is that the fragment 'CAT' and/or the number '5' both appear in the Description or both appear in the model (etc) for the condition to be satisfied.

The existing algorithm works fine for 'OR' concatenations, but returns incorrect results for 'AND' concatenations.

Expand All / Collapse All

Corrections to Search Algorithm Mike Browning 21 Mar 2002

Complete rewrite of the search algorithm in advanced_search_result.php (around line 203). Frankly, it was broken.

Regardless of which condition (AND / OR) was set as the default concatenation operator.

In the stock algorithm, if ONE search word appeared in the products_name, and ANOTHER search word appeared in products_model, then the product met the criteria. However, the logical expectation is that the words appear in the SAME fields(s).

In other words, for the criteria to be met, the condition must be satisfied in whole within the context of a single data attribute. For example: In the existing algorithm, if the word fragment 'CAT' appeared anywhere in the description, and the number '5' appeared in the model, then a search for 'CAT 5' would be satisfied.. but not the intention.

What is intended is that the fragment 'CAT' and/or the number '5' both appear in the Description or both appear in the model (etc) for the condition to be satisfied.

The existing algorithm works fine for 'OR' concatenations, but returns incorrect results for 'AND' concatenations.

Note: Contributions are used at own risk.