0
votes

I want to search for a href value with lucene/examine - more precise the 'locallink' value. Examine is straight out-of-the-box standard config.

I have the following snippet which does not return any results;

string searchQuery = "localLink:" + id;
UmbracoHelper helper = new UmbracoHelper(UmbracoContext.Current);

foreach (var result in helper.Search(searchQuery, false))
{
    // Do something
}

Upon inspection of the index via Developer > Examine Management (in Umbraco backend), I can see that the index does contain the value I am trying to search for but under a "_Raw" property. So I guess the question is, how I can make my search, search in these fields also?

1

1 Answers

0
votes

You made search with UmbracoHelper. Try to use Examine Searcher as described in docs :

    var searcher = ExamineManager.Instance.SearchProviderCollection["WebsiteSearcher"];
    var searchCriteria = searcher.CreateSearchCriteria(BooleanOperation.Or);
    var searchResults = searcher.Search(query);

http://our.umbraco.org/documentation/Reference/Searching/Examine/

http://umbraco.com/follow-us/blog-archive/2011/9/16/examining-examine.aspx