How would I pass in arguments like "Fuzzy" or "Boost" into this search? It seems like this should work but its throwing a error: query.AppendFormat("-{0}:1 ", model.HideFromSearchField, Fuzzy());
Amir, as a quick hack (not a proper solution at), in the searchTerms loop, I just replaced the term with one with some fuzziness and then took out the wildcard "*" because they were conflicting. There are ways to have them work together, but I didn't really need it in my case. Anyway, here's what I did.
foreach (var term in model.SearchTerms)
{
string t = string.Format("({0}~0.6)", term.Trim().Replace(" ", "~0.6 "));
var groupedOr = new StringBuilder();
foreach (var searchField in model.SearchFields)
{
groupedOr.AppendFormat("{0}:{1} ", searchField, t);
}
query.Append("+(" + groupedOr.ToString() + ") ");
}
I modified in both loops where it goes over the search terms.
Fuzzy search
Hi,
How would I pass in arguments like "Fuzzy" or "Boost" into this search? It seems like this should work but its throwing a error: query.AppendFormat("-{0}:1 ", model.HideFromSearchField, Fuzzy());
Any ideas?
-Amir
Anyone able to get this working?
Amir, as a quick hack (not a proper solution at), in the searchTerms loop, I just replaced the term with one with some fuzziness and then took out the wildcard "*" because they were conflicting. There are ways to have them work together, but I didn't really need it in my case. Anyway, here's what I did.
I modified in both loops where it goes over the search terms.
Hope this helps.
is working on a reply...