Search "Our" Use Full Text Search with Contains in SQL Server -
we use full text search , contains
search between records in sql server 2008 r2, here samples:
news(title): "we", "new", "our", "long-term", "seem", "non.active"
so see in news
table title field have values. can search of values except "long-term" , "non.active"
, can not search words includes dash("-") or dot("."). check these tips:
select * news contains(title, 'non.active'); select * news contains(title, 'non active'); select * news contains(title, 'nonactive'); select * news contains(title, 'non*'); select * news contains(title, 'active'); select * news contains(title, 'non'); select * news contains(title, '*active'); select * news contains(title, ' "non.active" '); select * news contains(title, ' "non active" '); select * news contains(title, ' "nonactive" '); select * news contains(title, ' "non*" '); select * news contains(title, ' "*active" '); select * news contains(title, ' "active" '); select * news contains(title, ' "non" ');
but none of them return result. rebuild full text index , yet did not result.
so question is: there way search words include "." or "-" full text contains
predicate? suggestion
update
i'm sorry main problem another?
you right 2 words of "non" , "action". main case test "we.our" , steel not return result? that's wired, test "non.action" above search , worked "we.our" don't. try record, inserted "our" , search result yet null. problem "our" word? problem "our" check in sql server 2012, , not worked also. there 1 have idea this?
you can check how needed data stored in fulltext catalog:
select * sys.dm_fts_index_keywords_by_document(db_id('dbname'), object_id('tablename')) document_id = <unique id>
what "our" word, seems stop-word.
Comments
Post a Comment