views:

54

answers:

0

I want to search product information using Full Text Search, I have used six table in search query but i faced below issue

I want to use full text search in SQL Server 2005. So I am facing the problems which is as below.

1) I am using 6 tables.

i)   Product (ProductID primary key,Name,Description,Summary,ImageFileNameOverride)
ii)  Manufacturer(ManufacturerID,Name,Description)
iii) Category(CategoryID,Name,Description)
iv)  ProductCategory(ProductID,CategoryID)
v)   ProductManufacturer(ProductID,ManufacturerID)
vi)  ProductVariant(ProductID,VariantID,SalePrice)

I want this result

 ProductID, ProductName, ManufacturerName, CategoryName, 
 ProductSummary, SalePrice, ImageFileNameOverride

2) One can product have multiple category.

3) While I create a view the index in not possible because there was an error

The CREATE UNIQUE INDEX statement terminated because a duplicate key was 
found for the object name 'dbo.ViewSearch' and the index name 'IX_ViewSearch'. 
The duplicate key value is (3)."

4) I have tried also with temporary table but the it gave me an error that #temp is not available.

5) When I change the datatype in view because index is not perform on ntext, image, text and xml type so i have converted to varchar(max) but still it gave me an error that there may be a usage of image, ntext, text or xml value.

6) And when perform the below query

SELECT 
    product.ProductID,
    product.Name,
    product.Description,
    SalePrice,
    Product.ImageFilenameOverride 
FROM   
    product, ProductVariant, Category 
WHERE    
    FREETEXT((Category.Name, product.Name, product.description, product.summary, product.SETitle, product.SEDescription),'"Apple"')   
    AND Product.ProductID=ProductVariant.ProductID

it gave me an error that Fulltext predicate references columns from two different tables or indexed views 'Category' and 'product' which is not allowed.

So please give me a solution as soon as possible

Thanking you