Goal is to allow searches on Table data such as a string field contains any part of the word, and a number RANGE? so there is some table, then in the UI a panel of search boxes for each column. So on a numeric column the user can say %>2, <7% and items
from 3 to 6 are returned?
Great. So its a table, needs full text search enabled, so Ive done this 2 different ways now. Then go and use "contains" in a sql query and it fails saying it must have full text enabled. Ok, enable full text then!! Error: full text already enabled.
SQL Server Management studio
table-> Mytable -> full text indexing
New Wizard: welcome to the sql server full text indexing wizard, go thru that.
<div>===================================</div> <div></div> <div>A full-text index for table or indexed view 'dbo.myTable1' has already been created. (.Net SqlClient Data Provider)</div> <div></div> <div>------------------------------</div>
<div>For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=13.00.1742&EvtSrc=MSSQLServer&EvtID=7652&LinkId=20476</div> <div></div> <div>------------------------------</div> <div>Server
Name: thAstr.xu.com</div> <div>Error Number: 7652</div> <div>Severity: 16</div> <div>State: 1</div> <div>Line Number: 1</div> <div></div>
Then go run a query? Msg 7601, Level 16, State 3, Line 25 Cannot use a CONTAINS or FREETEXT predicate on column 'rTTR ID' because it is not full-text indexed.
So then how does make the table full text indexed?
Hold on. I was running the query as if it was a string column, its a FLOAT column. So it is full text indexed.
Ok
But how to provide the user some option to search for numerics in a range? provide 3 text boxes? or what do you give the user in the textbox to search between 2 values?
What can the USER type in one text box to do the range? should they use SQL syntax and just concatenate into the SQL query string? (no)
But how to provide the user some option to search for numerics in a range? provide 3 text boxes? or what do you give the user in the textbox to search between 2 values?
Member
126 Points
873 Posts
How to activate the Full Text search?
Feb 19, 2020 08:16 PM|rogersbr|LINK
Goal is to allow searches on Table data such as a string field contains any part of the word, and a number RANGE? so there is some table, then in the UI a panel of search boxes for each column. So on a numeric column the user can say %>2, <7% and items from 3 to 6 are returned?
All-Star
53021 Points
23607 Posts
Re: How to activate the Full Text search?
Feb 19, 2020 08:26 PM|mgebhard|LINK
Full text search is covered in the docs. Share your code and table schema if you have a specific problem that you need help solving.
https://docs.microsoft.com/en-us/sql/relational-databases/search/full-text-search?view=sql-server-ver15
For numeric fields use BETWEEN or < and >.
Member
126 Points
873 Posts
Re: How to activate the Full Text search?
Feb 19, 2020 08:42 PM|rogersbr|LINK
Great. So its a table, needs full text search enabled, so Ive done this 2 different ways now. Then go and use "contains" in a sql query and it fails saying it must have full text enabled. Ok, enable full text then!! Error: full text already enabled.
SQL Server Management studio
table-> Mytable -> full text indexing
New Wizard: welcome to the sql server full text indexing wizard, go thru that.
<div>===================================</div> <div> </div> <div>A full-text index for table or indexed view 'dbo.myTable1' has already been created. (.Net SqlClient Data Provider)</div> <div> </div> <div>------------------------------</div> <div>For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=13.00.1742&EvtSrc=MSSQLServer&EvtID=7652&LinkId=20476</div> <div> </div> <div>------------------------------</div> <div>Server Name: thAstr.xu.com</div> <div>Error Number: 7652</div> <div>Severity: 16</div> <div>State: 1</div> <div>Line Number: 1</div> <div></div>
Then go run a query? Msg 7601, Level 16, State 3, Line 25
Cannot use a CONTAINS or FREETEXT predicate on column 'rTTR ID' because it is not full-text indexed.
So then how does make the table full text indexed?
Member
126 Points
873 Posts
Re: How to activate the Full Text search?
Feb 19, 2020 08:51 PM|rogersbr|LINK
Hold on. I was running the query as if it was a string column, its a FLOAT column. So it is full text indexed.
Ok
But how to provide the user some option to search for numerics in a range? provide 3 text boxes? or what do you give the user in the textbox to search between 2 values?
What can the USER type in one text box to do the range? should they use SQL syntax and just concatenate into the SQL query string? (no)
All-Star
53021 Points
23607 Posts
Re: How to activate the Full Text search?
Feb 19, 2020 08:58 PM|mgebhard|LINK
I recommend two inputs; a max and a min.