views:

76

answers:

3

I am looking for something that will take a complex search string and allow me to test it against some text to determine whether the text meets the search criteria.

I would like to support query syntax similar to google/twitter (i.e. support for: and, or, not, exact string, wildcards, etc) and would also like it to handle plurals of words (maybe synonyms if I could have my cake and eat it). I guess what I want is the analysis and query aspects of a search engine without building and maintaining an index.

I really would like to avoid developing this, and thought that it seems like it might be a fairly common requirement. But I have been unable to identify anything in the .net world that specifically meets my needs.

I thought I might be able to use elements of Lucene.net to do this, but have no experience with it. So I would like to know if anybody out there has any ideas that might help or if they have done this before (and what they used). Would be happy to consider non-.NET solutions if integration is possible.

Any input is much appreciated.

Regards Allen

A: 

can't you just use regex ?

Yassir
A: 

Not .NET but maybe you can grab some ideas from here: http://eigenclass.org/hiki/simple+full+text+search+engine

Konamiman
This is really interesting - thanks.
+2  A: 

Regex is exactly your solution.

The only thing you mentioned it doesn't support is synonyms and plurals obviously, because that is language depended. But I guess, you can easily get a list of synonyms, or exceptional plurals in English or something like that, and then write your Regex builder for those (really easy).

Regex is a shortcut for Regular Expressions, and is a well known engine, that exist in a lot of languages' libraries.

A nice site you can learn Regex from is http://www.regular-expressions.info/.

In dot net, all the Regex related classes are in System.Text.RegularExpressions. you can guess quite easily by yourself how to use it... (or just google C# REGEX or something)

Itay