1

I am considering design of a WCF 4 application. It will run on IIS6 and Windows Server 2003 using the .NET Framework 4.0 and MySQL databases.

The service needs to allow full text search capabilities, but I'm not finding any resources that show how to do this. I see how to return results using specific data, like GetData(234) to return a record with ID=234. But suppose I want to search a VarChar or Text column for arbitrary criteria. Like, "green AND yellow", where a Text column may contain these 2 search terms ANYWHERE in the data. I will probably want to search by datetime as well, so all rows where datetime is earlier the 01/01/2012, Text contains green and yellow, and ID=234, etc.

WCF is straightforward on how to return results for all rows or a row with a specified column value, but I'm not seeing where it will return rows using a full text search.

Is anyone aware of a link that illustrates how to return a list of rows using an advanced search form?

rwkiii
  • 5,716
  • 18
  • 65
  • 114

1 Answers1

1

WCF won't help you with the actual full-text search functionality. Of course, you need to design a contract that allows for paged searching, returning useful DataContracts, etc., but the hard part is elsewhere.

You haven't been specific on what actual full-text capabilities you need, but there are at least two ways to go:

  • Use MySQL Full-Text Search capabilities. Based on the search parameter(s) in your service operation you'll execute a MySQL query which will return rows from the appropriate tables. Your service can return corresponding results (domain objects, poco's, etc).
  • Use SOLR / Lucene, on top of / in tandem with your MySQL database. (There's a question on which one to use.)

So in summary: the service won't have full-text search capabilities, it will just be a gateway to those features.

Community
  • 1
  • 1
Jeroen
  • 60,696
  • 40
  • 206
  • 339
  • Thank you Jeroen. This answer helps me out. I just needed to understand if WCF could help with full-text searching or not. I didn't think it could. In my case MySQL full-text indexing is the way to handle it and I understand using parameters to construct the SELECT statement. – rwkiii Oct 25 '12 at 02:39