Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

plural form of search string with CONTAINS in full text search Expand / Collapse
Author
Message
Posted Friday, July 26, 2013 3:02 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 11:45 AM
Points: 151, Visits: 448
I'm using CONTAINS to search for a string or word. If I search for Hobby is it possible to make it search for Hobbies also, which is the plural of Hobby? FREETEXT seems to be doing this but I want to do it with CONTAINS because it will make me search with an AND clause. FREETEXT using OR clause which I don't need.

For example if I do below search for 'John AND Hobby', I would like to get strings that have both John and Hobby / Hobbies

WHERE contains (*, 'John AND Hobby' )
Post #1478214
Posted Friday, July 26, 2013 3:20 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Sunday, September 29, 2013 1:24 AM
Points: 429, Visits: 1,721
sql server developer (7/26/2013)
I'm using CONTAINS to search for a string or word. If I search for Hobby is it possible to make it search for Hobbies also, which is the plural of Hobby? FREETEXT seems to be doing this but I want to do it with CONTAINS because it will make me search with an AND clause. FREETEXT using OR clause which I don't need.

For example if I do below search for 'John AND Hobby', I would like to get strings that have both John and Hobby / Hobbies

WHERE contains (*, 'John AND Hobby' )

You need to use CONTAINSTABLE to do proximity searching. Once the query is set up correctly with CONTAINSTABLE it will return the results with a column showing the ranking of the search results. There are many options for setting the various proximity variables.

CONTAINSTABLE

 
Post #1478218
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse