Search

Aug 10, 2011 at 7:53 PM

May be useful:

public static class IndexTankExtensions
{
        public static SearchResult Search(this Index index, string query, params string[] args)
        {
            return index.Search(string.Format(query, args));
        }
}

Coordinator
Aug 10, 2011 at 11:15 PM

Won't this method will fail if there are no parameters in the query. How are you checking for that?

Say I use it like this:

 

string query = "I love blueberries";

string args = new {"title", "text", "url"}

index.Search(query, args);

 

Aug 11, 2011 at 7:24 AM

Yes, in that case this method will throw System.FormatException.

But I don't see any reason for checking that.