You are here:  » searching issue

Support Forum



searching issue

Submitted by amz_4u2nv on Mon, 2013-03-11 21:27 in

Hi David,
Just started to use your script, but I am having difficulties in doing a search on a product..
typing in one word in the search box brings back no rows.. however if I type in the full name it comes up -
i.e. name is wedding cake

SELECT SQL_CALC_FOUND_ROWS * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants, MATCH name AGAINST ('reena mendhi henna') AS relevance FROM `wedding_products` WHERE MATCH name AGAINST ('cake') GROUP BY name

the above will bring back nothing

but the below does -

SELECT SQL_CALC_FOUND_ROWS * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants, MATCH name AGAINST ('reena mendhi henna') AS relevance FROM `wedding_products` WHERE MATCH name AGAINST ('wedding cake') GROUP BY name

Using a like works fine... any ideas?

Cheers
Amit

Submitted by support on Mon, 2013-03-11 21:37

Hello Amit, and welcome to the forum!

This looks like a MySQL FULLTEXT frequency issue - in that any words present in > 50% of records are not included in the full text index. In some cases for niche sites disabling the full text index yields better results. To do this, in your config.advanced.php change line 8 as follows:

  $config_useFullText = FALSE;

That should improve results in this particular case, but if not let me know, and if possible if you could include example search result URLs (I'll remove the details before publishing your reply) I'll check it out further with you...

Cheers,
David.
--
PriceTapestry.com

Submitted by amz_4u2nv on Tue, 2013-03-12 10:46

Hi David,
Sorry, I forgot to add the form action to be search.php... dopey me...
Works ok now.

Cheers,
Amit

Submitted by amz_4u2nv on Tue, 2013-03-12 11:33

Hi David,
I switched the config_useFulltext variable you mentioned, which works for all pages except the homepage -
any ideas -

http://www.hhhhh.co.uk/?q=reena
http://www.hhhhh.co.uk/merchant/?q=aaa
doesn't work either -
It could be .htaccess file - but it looks fine to me-

Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^product/(.*).html$ products.php?q=$1&rewrite=1&%{QUERY_STRING} [L]
RewriteRule ^review/(.*).html$ reviews.php?q=$1&rewrite=1&%{QUERY_STRING} [L]
RewriteRule ^merchant/$ merchants.php
RewriteRule ^merchant/(.*)/$ search.php?q=merchant:$1:&rewrite=1&%{QUERY_STRING} [L]
RewriteRule ^merchant/(.*)/(.*).html$ search.php?q=merchant:$1:&page=$2&rewrite=1&%{QUERY_STRING} [L]
RewriteRule ^category/$ categories.php
RewriteRule ^category/(.*)/$ search.php?q=category:$1:&rewrite=1&%{QUERY_STRING} [L]
RewriteRule ^category/(.*)/(.*).html$ search.php?q=category:$1:&page=$2&rewrite=1&%{QUERY_STRING} [L]
RewriteRule ^brand/$ brands.php
RewriteRule ^brand/(.*)/$ search.php?q=brand:$1:&rewrite=1&%{QUERY_STRING} [L]
RewriteRule ^brand/(.*)/(.*).html$ search.php?q=brand:$1:&page=$2&rewrite=1&%{QUERY_STRING} [L]

Any ideas?

Cheers,
Amit

Submitted by support on Tue, 2013-03-12 11:41

Hello Amit,

That looks like your $config_baseHREF value in config.php may be incorrect (it looks like it's empty from studying the example URLs). With a Price Tapestry installation in the root (top level folder) of your website, the setting (line 6) should be:

  $config_baseHREF = "/";

Cheers,
David.
--
PriceTapestry.com

Submitted by amz_4u2nv on Tue, 2013-03-12 13:34

Thanks David,
Got it sorted.

Cheers,
Amit