Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have created a full text catalog for a column under database name -> "Storage" -> Full Text Catalogs. It is accent sensitive and "default catalog" is set to false. The language for the column "SearchData" is set to swedish.

I am using a stored procedure that calls the contains function like this:

CREATE PROCEDURE [dbo].[SearchPages]
    @Term varchar(200)
AS
BEGIN
    SELECT pc.SearchData from PageContent pc
    where contains(pc.SearchData, @Term)
END

When I search för "smörgås" (swedish för "sandwich"), I hit on "smörgåsbord", but not on "smörgåsar" (swedish for "sandwishes").

Apparently, it only hits on words that are compositions containing the search term, but not on plural forms.

Our customers want to search putting a singular form in the search box.

Is that possible to obtain? It would also be nice if you could search for "goose" and find "geese".

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You could use either CONTAINS with FORMSOF(INFLECTIONAL, smörgås) or FREETEXT

CONTAINS:

SELECT pc.SearchData from PageContent pc
WHERE CONTAINS(pc.SearchData, 'FORMSOF(INFLECTIONAL, smörgås)', LANGUAGE 'Swedish')

FREETEXT (includes INFLECTIONAL and some other stuff automatically):

SELECT pc.SearchData from PageContent pc
WHERE FREETEXT(pc.SearchData, 'smörgås', LANGUAGE 'Swedish')
share|improve this answer

Try to set @Term variable this way (double quotes and star are important):

SET @Term = '"smörgås*"'

Or you may try to set thesaurus for synonyms like "goose" and "geese": http://msdn.microsoft.com/en-us/library/ms142491.aspx

share|improve this answer
    
But I dont want to find every word starting with smörgås, although it may seem like that in my question –  Anders Lindén Jul 30 '13 at 14:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.