Sitecore Ankiro Search is a nightmare and a blessing. Once you have it going you have one of the most advanced search engines available.
One of the cool features is that seperate fields of one Sitecore template can be indexed seperately. This gives you an execllent method to index metadata along with your contents.
But what if you wish to search for one sentence in one field and another sentence in another field? Well, you’ll need some c# code for that. Use the SearchBuilder. With the SearchBuilder you construct your search query before you execute the search. In this example I construct my SearchBuilder and searches for “a” in column “Title” and “b” in column “Text”:
using Sitecore.Ankiro.Search; using Sitecore.Ankiro.Search.SearchConstruction; SearchBuilder builder = SearchFactory.Instance.CreateSearchBuilder("MyIndex"); SearchOperatorNode andOperator = builder.CreateOperatorNode(ESearchOperation.AndOperation); SearchNode searchNode1 = builder.CreateIndexColumnsSearchNode("a", EPropertyInterpretation.Normal, 1.0, 0.8, "MyIndex", "Title"); SearchNode searchNode2 = builder.CreateIndexColumnsSearchNode("b", EPropertyInterpretation.Normal, 1.0, 0.8, "MyIndex", "Text"); andOperator.AppendChild(searchNode1); andOperator.AppendChild(searchNode2); builder.RootNode = andOperator; System.Xml.XmlDocument doc = SearchFactory.Instance.ExecuteSearch("", builder, 10, 0);