We help IT Professionals succeed at work.

Can't find part numbers with hyphens

471 Views
Last Modified: 2012-06-21
Where doing a search on an SQL Server 2005 fulltext catalog for part numbers, I don't get correct answers. In fact, the results are accurate for all the characters in the search up to the first hyphen.

Say I search for "326 IAC 2-6.1-7" (including the quotes) I get results for "326 IAC 2". This a problem as searching for reference numbers formatted like this is a viatl part o the search functionality of our db.

How can I make sure the above search only returns rows that match the input text exactly?
Comment
Watch Question

Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
don't use FULLTEXT index search for exact matches. the hyphens, dots etc are "word separators", and you won't be able to do anything about that.

Author

Commented:
I am using CONTAINS(*,'"326 IAC 2-6.1-7"') which is supposed to give an exact match.
Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
yes, but the full-text index breaks the data to be indexed by the "-" and ".", so it cannot give you exact matches
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.