I'm writing an application in C# using Full Text Search queries in SQL Server 2014. The user needs to be able to search the database using a very large query containing up to 100 000 parameters. For instance:
FTS Query:
SELECT * FROM Client WHERE contains(Name, '"John" OR "Sarah"')
LIKE query:
SELECT * FROM Client WHERE Name in ('John', 'Sarah')
Except instead of 2 names, we have 100 000 names. Obviously, this exceeds the maximum query length supported by SQL. The database contains a bit over 1 million records. In some cases I will need to find client names starting with a specified string, which is why FTS is preferable over "in" or "like" clauses. Is there some clever way of bypassing that other than batching the requests into many chunks? Are there any better alternative to using an SQL database?
I've also tried implementing the search using Lucene.NET, but generating an index for over 1 million records takes many hours, which is not acceptable, as the data will be synchronized daily.