SQL 全文索引包含

SQL Full Text Index Contains

我是 SQL FTI 的新手,我正在尝试完善针对 table 的搜索,其中包含数百万种不同的产品。

如果我通过这样的搜索:

select top 100 * from OMG_ProductFeeds.dbo.tbl_products
 where CONTAINS(ProductName,'"apple iphone 6"')

我得到了这些结果:

Acm Rich Leather Soft Carry Case For Apple Iphone 6 Mobile Handpouch Holder Cover - Black
Apple iPhone 6 - 16 GB
Apple iPhone 6 Plus - 64 GB
Apple iPhone 6 - 64 GB
Apple iPhone 6 Plus - 16 GB
Chevron Set Of 3 Ultra Clear Screen Guard + 3 Matte Finish Screen Guard For Apple Iphone 6 - Combo Offer
Softy Back Cover Case For Apple Iphone 6 - Golden
Chevron Ultra Clear Hd Finish Screen Guard Protector For Apple Iphone 6 (pack Of 5)

我希望能够包含实际的 iphone 6 部手机,但忽略任何外围设备,例如手机壳和屏幕保护膜,但我不确定该怎么做。

如有任何建议,我们将不胜感激。

谢谢

您可以考虑使用额外的 table - tbl_product_categories.

重新设计您的数据库结构

tbl_products中我们可以添加一个外键列来引用tbl_product_categories中的相应类别。这样您就可以仅使用特定关键字过滤特定类别。

SELECT TOP 100 *
FROM OMG_PRODUCTFEEDS.DBO.TBL_PRODUCTS
WHERE CONTAINS(PRODUCTNAME,'"APPLE IPHONE 6"')
AND product_category_id = 1;