views:

34

answers:

1

Hi I have 2 following 2 queries:

SELECT FT_TBL.JobId, FT_TBL.Title, FT_TBL.[Description], 
     FT_TBL.Location, KEY_TBL.RANK FROM Jobs AS FT_TBL 
INNER JOIN FREETEXTTABLE (Jobs, (Title, [Description], Location), 
    'asp.net software')
    AS KEY_TBL on FT_TBL.JobId = KEY_TBL.[KEY]
WHERE CONTAINS (Location, '"luton*"')
order by KEY_TBL.RANK desc;

and

SELECT FT_TBL.JobId, FT_TBL.Title, FT_TBL.[Description], 
    FT_TBL.Location, KEY_TBL.RANK FROM Jobs AS FT_TBL 
INNER JOIN FREETEXTTABLE (Jobs, (Title, [Description], Location), 
    'asp.net software', 100)
    AS KEY_TBL on FT_TBL.JobId = KEY_TBL.[KEY]
WHERE CONTAINS (Location, '"luton*"')
order by KEY_TBL.RANK desc;

The only difference is the second one has a top_n_by_rank parameter set to 100, the first one returns 1000+ results, I thought the second one would return 100, but it returns 0 results, why is this? How should I change the top_n_by_rank parameter to make sure I get only the best results?

A: 

The top 100 results probably don't match "luton*, and get filtered away by your WHERE clause.

Andomar
They thing is they do :( half of all location fields contain luton in my table, the rest contain london.
David
I realised that the top_n_by_rank parameter simply adds further algorithmic logic to the return result to filter only the best of best matches depending on the number specified, therefore I left this out, simply ordered by rank descending and selected the top 150 max of my results to prevent strains on resources. Job done.
David