1

Is there the possibility by using EF.Functions.FreeText to search on multiple columns?

The function accepts as input parameters: the column in which to perform the search and the string to search for, but in the documentation I cannot find anything that makes me understand if I can execute it in this context FREETEXT ((col1, col2, col3), 'search')

Riccardo Pezzolati
  • 357
  • 1
  • 4
  • 15
  • EF Core 5 does not support this yet - see [this issue](https://github.com/dotnet/efcore/issues/10462). – NetMage Jan 16 '21 at 00:07

1 Answers1

2

You could use the && Operator to chain them

_context.Foo.Where(x => EF.Functions.FreeText("Column1", "Search Text") && EF.Functions.FreeText("Column2", "Search Text"));

If you want to do it dynamically I fear that you have to use FromSqlRaw

Athii
  • 559
  • 5
  • 19