sql server - Partial Keyword Searching (MS SQL 2005) -


current, i've got stored procedure has main goal of doing full text search through database table of films , tv shows. in order partial-keyword searching, added code in sql split search query spaces, , output statement following:

' "batman*" ~ "be*" '

the original string, "batman be", instance, generated textbox on page user typing , on each javascript keyup event, send whatever in textbox stored proc results results type (like autocomplete). in case, user may have been looking "batman begins", or "the batman: batgirl begins" (a tv show episode) , both should show result.

below sample of query. @partialkeywordstring is, in example above, ' "batman*" ~ "be*" '.

select f.title films f inner join     containstable(films, title, @partialkeywordstring) f_key on f.filmid = f_key.[key] order f_key.rank desc 

the problem have query ranking doesn't seem i'd expect. if search "batman", 1 believe movie titles, beginning with, or containing word "batman" appear first. don't. sample result of happens when 1 searches "batman" below:

"batman: animated series - episode 114" "adventures of batman , robin - episode 218" "batman , robin - episode 101" "the batman - episode 101" "batman , robin - episode 204"

much further down list movie searching for--"batman begins" or "batman".

i'm looking advice on how tweak query--i'm not sql expert, , feel man-handled above code work. have feeling there's more elegant or powerful solution, , haven't found yet.

thank in advance

after more researching, i'm going try , use lucene.net movie-title search engine, , not rely on full-text searching in sql server 2005. testing shows results have been better , more relevant lucene. search "batman" returns following partial result-set:

  • batman
  • batman begins
  • batman returns
  • batman , robin: batman takes over
  • batman beyond: touch of curarĂ©
  • batman beyond: babel
  • the batman: season 02
  • the batman: topsy turvy
  • batman , robin: tunnel of terror
  • batman beyond [animated tv series]
  • the new adventures of batman: curses! oiled again!
  • the new adventures of batman: looks job bat-mite!

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -