containstable

Why is SQL Server full-text search not matching numbers?

偶尔善良 提交于 2020-06-12 06:03:23
问题 I'm using SQL Server 2014 Express, and have a full-text index setup on a table. The full-text index only indexes a single column, in this example named foo . The table has 3 rows in it. The values in the 3 rows, for that full-text indexed column are like so ... test 1 test 2 test 3 test 1 Each new line above is a new row in the table, and that text is literally what is in the full-text indexed column. So, using SQL Server's CONTAINS function, if I perform the following query, I get all rows

SQL Server ContainsTable not returning result with term “inn”

假如想象 提交于 2020-01-02 05:32:07
问题 I have a table called hotel with the following information: Hotel_Id : 2950 Hotel_Name : Inn on the Park Hotel_Number : 01234567 Hotel_TypeId : 1 I need to be able to search for records where the name column contains certain terms. The search is: select * from ContainsTable(hotel, Hotel_Name, '"Inn on Park"') I get no results but if I search: select * from ContainsTable(hotel, Hotel_Name, '"In on Park"') I get Key: 2950 Rank: 176 I figured there was some issue with the term "inn" but if I

Near matches not found in CONTAINSTABLE

这一生的挚爱 提交于 2019-12-12 16:13:46
问题 I am using SQL Server 2008 DDL CREATE TABLE [dbo].[t]( [words] [varchar](1000) NULL, [id] [int] IDENTITY(1,1) NOT NULL ) ON [PRIMARY] DML insert into t(words)values('this is my laptop') insert into t(words)values('this does not contains headphone') SQL Query SELECT * FROM t as t JOIN CONTAINSTABLE(t, words,'"headphone*"', 10) fulltextSearch ON t.Id = fulltextSearch.[KEY] Results No record found I am expecting one records. Any Idea? 回答1: 'this' is very likely a noise word (like 'the', 'and',

Can I use a variable when using ISABOUT?

大城市里の小女人 提交于 2019-12-10 20:49:56
问题 I'm trying to use a stored procedure to create a table that ranks posts by taking a topic name and using keywords and weights associated with that topic name to determine how they should be ranked. I've been trying to use CONTAINSTABLE and ISABOUT, but I'm having trouble with putting the keywords and weights into the ISABOUT statement. I've tried converting the keywords and weights from the table they're in into a varchar variable, and putting that variable into the ISABOUT statement, but

SQL Server, ISABOUT, weighted terms

南楼画角 提交于 2019-12-10 03:00:43
问题 I am trying to figure out exactly how weighted terms work in an ISABOUT query in SQL SERVER. Here is where I currently am: Each query returns the following rows: QUERY 1 (weight 1): Initial ranking SELECT * FROM CONTAINSTABLE(documentParts, title, 'ISABOUT ("e" weight (1) ) ') ORDER BY RANK DESC, [KEY] KEY RANK 306342 249 272619 156 221557 114 QUERY 2 (weight 0.8): Ranking increases, initial order is preserved SELECT * FROM CONTAINSTABLE(documentParts, title, 'ISABOUT ("e" weight (0.8) ) ')

SQL Server ContainsTable not returning result with term “inn”

随声附和 提交于 2019-12-05 18:25:13
I have a table called hotel with the following information: Hotel_Id : 2950 Hotel_Name : Inn on the Park Hotel_Number : 01234567 Hotel_TypeId : 1 I need to be able to search for records where the name column contains certain terms. The search is: select * from ContainsTable(hotel, Hotel_Name, '"Inn on Park"') I get no results but if I search: select * from ContainsTable(hotel, Hotel_Name, '"In on Park"') I get Key: 2950 Rank: 176 I figured there was some issue with the term "inn" but if I search for: select * from ContainsTable(hotel, Hotel_Name, '"Inn"') I get back the same key: 2950, Rank:

SQL Server, ISABOUT, weighted terms

╄→гoц情女王★ 提交于 2019-12-05 03:40:37
I am trying to figure out exactly how weighted terms work in an ISABOUT query in SQL SERVER. Here is where I currently am: Each query returns the following rows: QUERY 1 (weight 1): Initial ranking SELECT * FROM CONTAINSTABLE(documentParts, title, 'ISABOUT ("e" weight (1) ) ') ORDER BY RANK DESC, [KEY] KEY RANK 306342 249 272619 156 221557 114 QUERY 2 (weight 0.8): Ranking increases, initial order is preserved SELECT * FROM CONTAINSTABLE(documentParts, title, 'ISABOUT ("e" weight (0.8) ) ') ORDER BY RANK DESC, [KEY] KEY RANK 306342 321 272619 201 221557 146 QUERY 3 (weight 0.2): Ranking

how to write containstable searchcondition with and's and or's

好久不见. 提交于 2019-12-04 02:52:41
问题 Currently trying to write a select statement with a containstable and the search condition is giving me some grief. The purpose is to search a table with 3 different parameter types and rank the output accordingly. (below is sample of my code) Key search condition (must-have and weighted at 1) || testvalue = Accountant Additional must-have (weighted .8) || testvalue = Manager Nice to have (weighted .5) || testvalue = Excel SQL: SELECT KTBL.Rank as [Ranking], KeySkills FROM Applicants INNER