Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 VP-ASP 7.0 Questions
 Search whole words
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

[email protected]
VP-CART New User

149 Posts

Posted - January 14 2015 :  11:50:24  Show Profile  Reply with Quote
Hi,
Is there any way of altering the searching methods so that it will only return results when it finds a whole word match?

For example, we sell a variety of winter-esque products and someone may type in "ice" to see what ice-related products we have.
The problem is that results that don''t have the word "ice" in them still show up, triggered by the letters i-c-e in words like price, dice, mice, slice, etc...
Is there any way to change this so it will only return a result if the title/subtitle/description has the whole word ice and ignoring i-c-e if it is contained inside another word?

diegomilito
VP-CART Expert

Argentina
779 Posts

Posted - January 15 2015 :  00:20:04  Show Profile  Reply with Quote
what about using shopsearch.asp and u use "With the exact phrase" enter ice. i think that should work for u.
if not i will think other idea for u....
diego.
Go to Top of Page

[email protected]
VP-CART New User

149 Posts

Posted - January 16 2015 :  14:44:54  Show Profile  Reply with Quote
It''s possible, it just doesn''t work with the quick search in the top right hand corner.
I will see if it simply adds a variable to the url when the "with the exact phrase" is added...if so...I can add that variable to the end of the url in the quick search box


*update*
Just tested it out using the advanced search.
If I search for "ice cleats" while using "with the exact phrase"
it will work.
If I search for "ice" while using "with the exact phrase"
it goes back to the original problem of not finding whole words only

Edited by - [email protected] on January 16 2015 14:51:43
Go to Top of Page

diegomilito
VP-CART Expert

Argentina
779 Posts

Posted - January 16 2015 :  20:36:46  Show Profile  Reply with Quote
sunshore, what is ur website address. i want to play a bit with ice searching and wanting to see how your site result.
diego
Go to Top of Page

serjtankian
VP-CART Super User

Armenia
378 Posts

Posted - January 19 2015 :  11:39:01  Show Profile  Visit serjtankian's Homepage  Reply with Quote
i think you can find exact result if you activate ajax search? cmiiw






*serj*
Go to Top of Page

diegomilito
VP-CART Expert

Argentina
779 Posts

Posted - January 19 2015 :  19:56:57  Show Profile  Reply with Quote
serjt,ur idea will work. what i found when searching ajax feature is on, i search something with a word and it show result to me a listing suggestion where i only pickup the one i wanted.
sunshore, how about trying that idea ??
diego
Go to Top of Page

[email protected]
VP-CART New User

149 Posts

Posted - January 21 2015 :  13:50:24  Show Profile  Reply with Quote
My search has ajax enabled and searches through cname,cdescription,ccode,keywords

The website is http://fcsurplus.ca/shopping/ to go through quick search

For advanced search: http://www.fcsurplus.ca/shopping/shopsearch.asp



You can try to test it out with ice. I still can''t get it to search whole words only
Go to Top of Page

manilow
VP-CART New User

France
134 Posts

Posted - January 22 2015 :  03:58:04  Show Profile  Visit manilow's Homepage  Reply with Quote
I think it has something to do with the sql string generated in shopdisplayproducts.asp.

Check the sql string by including the following line at the top of shopdisplayproducts.asp (right after INCLUDE''s) :

response.Write("<! sql string = " & getSess("sqlnofilter") & "-->")

Generate a new search and check in the page source code for ''sql string''. This string should include an instruction cname = ''ice'' if you search for the keyword ''ice'', and not cname like ''%ice%''.

Kind regards,

Erik
www.aquathermia.com

Go to Top of Page

diegomilito
VP-CART Expert

Argentina
779 Posts

Posted - January 23 2015 :  20:35:18  Show Profile  Reply with Quote
if using cname = ''ice'', it just show product name ice , for product name ice cream, u wont get that ice cream in result....better using cname like ''%ice%''
how about my idea ?
diego
Go to Top of Page

manilow
VP-CART New User

France
134 Posts

Posted - January 24 2015 :  14:37:09  Show Profile  Visit manilow's Homepage  Reply with Quote
You''re right Diego.
cname = ''ice'' will only return the product with that exact name.
cname like ''%ice%'' is the right syntax.

To get only search results with the whole word ''ice'', the sql string should include cname like ''% ice %'' (including spaces).

Erik
www.aquathermia.com
Go to Top of Page

diegomilito
VP-CART Expert

Argentina
779 Posts

Posted - January 27 2015 :  22:50:36  Show Profile  Reply with Quote
hmm... include cname like ''% ice %'' (including spaces in left and right), if cname is like "ice cream" it will not get it. cname like "best ice cream" will return... so how bout including OR : cname like ''% ice %'' OR cname like ''%ice %'' OR cname like ''% ice%''. any comment is welcome.
diego
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00