FreeTextSearch_Rank isn't sorting correctly

I ran into an issue I can't resolve.

We implemented the fulltext search as you described in Vinayak's Weblog 'Catalog classtypes and search functionality in the catalog system'. We indexed the product tables and added a column 'keywords' to be able to manipulate the search.

For a search we expect the results to be displayed by rank, meaning the best match on top. When I do a search through our website I get a different sort as if I do a fulltext search directly in the database (using Query Analyzer). Also if I display the ranking I have completely different ranking rates for both searches. The bad thing is the search with the query analyzer gives me the correct ranking, whatever I change to the keywords field doesn't affect the search in the application but it does directly in the database.

here is a piece of my code:

CatalogSearchOptions _SearchOptions =newCatalogSearchOptions();

CatalogSearch _CatalogSearch = CurrentContext.CatalogSystem.GetCatalogSearch();

_SearchOptions.PropertiesToReturn ="ProductId,VariantId,Name,FreeTextSearch_Rank,SKU,DisplayName";

_SearchOptions.SortProperty ="[FreeTextSearch_Rank]";

_SearchOptions.SortDescending =true;

_SearchOptions.ClassTypes =CatalogClassTypes.ProductClass;

_CatalogSearch.UseAdvancedFreeTextSearch =false;

_CatalogSearch.CatalogNamesCollection = _CatalogCollection;

_CatalogSearch.SearchOptions = _SearchOptions;

_CatalogSearch.CatalogNames = CurrentContext.CatalogSystem.CatalogNames[0];

_CatalogSearch.Language ="en-US";

_CatalogSearch.FreeTextSearchPhrase = FormatFreeTextSearchString(SearchPhrase);

_CatalogItems = _CatalogSearch.Search();

[2123 byte] By [ToonNijland] at [2008-1-4]
# 1

You could try removing the line "_CatalogSearch.CatalogNamesCollection = _CatalogCollection;".

Also which two searches are you taking about in the line "Also if I display the ranking I have completely different ranking rates for both searches."?

SudhaRaghavan-MSFT at 2007-10-11 > top of Msdn Tech,Commerce Server,Commerce Server 2007...
# 2

Thank you

I was refering to a full text search I did on the same catalog using query analyzer. When I was displaying the "rank" column from my manual search and showed the ranks values in my webpage I noticed two completely different values for each product.

Anyway... I figured out how to solve this issue. I am not sure if it is the right way but I noticed that the fulltext search does work on the table "<CatalogName>_en-US_Catalog". So I added my keywords to that table, and now my search works just fine.

Thanks,

Toon

ToonNijland at 2007-10-11 > top of Msdn Tech,Commerce Server,Commerce Server 2007...