Full Text Search on Float Field

  • i have a db table with nvarchar,float and date time fields i was able to convert the date time to nvarchar and use it in full text search but not able to do it with float, even though i was able to convert the float to nvarchar i was not able to use it in full text search. the following error occurs when i try to use it in full text search.

    "computed coloum cannot be used for full text search because it is non deterministic or imprecise non persisted computed coloumn"

    please help

  • Can you post the definition of yuor computed column?

    -- Gianluca Sartori

  • str(exp1.ProjectSellPrice,25,2) as ProjectSellPrice

    i am converting the above field from float to string in my view and creating a full text index to my view, the error occurs when i try to index the above field (ProjectSellPrice).

  • In this case, I think you need to add the PERSISTED attribute in order to create the fulltext index.

    STR is not a precise function.

    SELECT COLUMNPROPERTY(OBJECT_ID('YourTableName'), 'YourColumnName', 'IsDeterministic'),

    COLUMNPROPERTY(OBJECT_ID('YourTableName'), 'YourColumnName', 'IsPrecise')

    This page on MSDN contains the guidelines for creating indexes on computed columns:

    http://msdn.microsoft.com/en-us/library/ms189292.aspx

    -- Gianluca Sartori

  • Thanks a lot Sartori,

    Even though the soultion given by you did not work out for me may be because i am not using the computed column but the link you provided helped a lot to move in the right direction. the issue was float field cannot be used in full text indexing even after converting it to string. so i changed the field type to decimal and then converted it to string using convert(nvarchar(50),decimal_field) in my view which was used for full text indexing

  • Actually, I was not trying to suggest a solution, I was only pointing out that float is not a precise type and cannot be used in indexed computed columns.

    Thanks for the feedback.

    -- Gianluca Sartori

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply