Queries are limited to 4000 characters.

zequion 401 Reputation points
2024-09-19T04:19:40.1633333+00:00

I am working on a semantic search engine and I need to be able to search for synonyms and inflections of the words in the phrase that the user enters.

I have encountered the problem that the parameter “contains_search_condition” of the Contains or ContainsTable command is limited to 4000 characters.

Just by searching for the synonyms and inflections of a word, this limit can be exceeded. It is not solved even if the words are entered into a Varchar(max) variable and passed to the parameter.

Several years ago I reported this problem and others that I have found in writing to Microsoft Spain, who reported it to Microsoft USA. They told me that "they were going to work on these problems."

I have not heard anything again and I need a solution, because I am stuck on this problem.

I can't write the text of the query because it says "violation of the code of conduct" and deletes the post.

imagen

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,690 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. LiHongMSFT-4306 26,791 Reputation points
    2024-09-19T06:55:32.63+00:00

    Hi @zequion

    Have you tried split the search conditions into multiple smaller conditions that fit with the 4000-character limit?

    Best regards,

    Cosmog


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.