0

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".

3

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')
-1

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

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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