CONTAINS(column_name, 'NEAR((John, Smith), 2)') Examples Example 1įor example, you could search for 'John' within two terms of 'Smith', as follows. ![]() The number of non-search terms, including stopwords, that occur between the first and last search terms must be less than or equal to the maximum distance, if the maximum distance is specified.įor more info about the syntax, see CONTAINS (Transact-SQL). Start with one of the specified search terms and end with the one of the other specified search terms.Ĭontain all of the specified search terms. To qualify as a match, a string of text must: If you specify the maximum number of terms, you can also specify that matches must contain the search terms in the specified order. You can specify the maximum number of non-search terms, or maximum distance, that separates the first and last search terms in order to constitute a match. You can search for words or phrases in any order, or you can search for words and phrases in a specific order. You can specify the maximum number of non-search terms that separate the first and last search terms. ![]() You can use the proximity term NEAR in a CONTAINS predicate or CONTAINSTABLE function to search for words or phrases near one another. Applies to: SQL Server (all supported versions) Azure SQL Database
0 Comments
Leave a Reply. |