Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Shane Boland 1 post 21 karma points
    Jul 02, 2013 @ 22:27
    Shane Boland
    0

    Examine/Search - need a VB.NET example

    I've watch the three Umbraco TV tutorials on how to start using Examine with Umbraco. I can see the index files and query them using Luke. But I can't seem to access the index through the C# samples I've found. I'm sure the problem is that I don't know C# but it could be something else. Does anyone have a VB.NET example of a search result page. Thanks in advance.

  • Darren 14 posts 34 karma points
    Jul 03, 2013 @ 00:13
    Darren
    0

    hi, here is some c# i use

    here is my provider as stated in the Examinesettgins.config:

    <add name="MySearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" indexSet="MyIndexSet"/>

    here is the code that runs on page load of my search results page:

    var Searcher = ExamineManager.Instance.SearchProviderCollection["MySearcher"];
    var searchCriteria = Searcher.CreateSearchCriteria();

    var query = searchCriteria.Field("fieldName", searchTerm).Compile();
    var searchResults = Searcher.Search(query);

Please Sign in or register to post replies

Write your reply to:

Draft