SQL Server ContainsTable does not return a result with the term "inn"

I have a table called hotelwith the following information:

  • Hotel_Id: 2950
  • Hotel_Name: Inn in the park
  • Hotel_Number: 01234567
  • Hotel_TypeId: 1

I need to be able to search for entries in which the name column contains certain terms.

Search:

select * 
from ContainsTable(hotel, Hotel_Name, '"Inn on Park"')

I am not getting results, but if I search:

select * 
from ContainsTable(hotel, Hotel_Name, '"In on Park"')

I get

Key: 2950
Rank: 176

I thought there was a problem with the term "hotel", but if I'm looking for:

select * 
from ContainsTable(hotel, Hotel_Name, '"Inn"')

I am returning the same key: 2950, โ€‹โ€‹result: 176.

Is "inn" a keyword that causes this problem?

+4
source share
1 answer

This is my theory.

Your hotel name,, Inn on the Parkwill be indexed as follows:

pos   word
1     Inn
2     (noise)
3     (noise)
4     Park

on / ( , ).

. , :

Query 1: "Inn on Park" -> "Inn (noise) Park"
Query 2: "In on Park" -> "(noise) (noise) Park"

( ) Inn (noise) (noise) Park, , .

, , Inn 1 1 Park. . Inn 1 Park 1 Inn 1 Park ( ).

"", , AND, OR NEAR:

"Inn" AND "Park"
"Inn*"
"Inn" NEAR "Park" 

, . , "" " " ( ):

enter image description here

enter image description here

+3

All Articles