My client needs me to write a speak app that can do a search where they can type in whatever field they want to equal a value in the search bar. Is there a way to do a search against Lucene to within Sitecore to allow a dynamic field?

1 Answer 1


Maybe I am misunderstanding you, but do you just want to pass in the field as a name and the value to search? Or is this deeper and you want the full speak pipelines for doing this search?

var yourField = "content";
var yourValue = "hello";

using (var searchContext = ContentSearchManager.GetIndex("sitecore_web_index").CreateSearchContext())
    var query = searchContext.GetQueryable<SearchResultItem>().Where(x => x[yourField] == yourValue);

    if (result != null)
        var results = query.GetResults();
  • Oh no, this should suffice provided this works Commented Nov 16, 2018 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.