Copied to clipboard

Flag this post as spam?

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


  • Corné Strijkert 77 posts 433 karma points
    Mar 04, 2019 @ 20:23
    Corné Strijkert
    0

    Where are the Examine config files located in v8?

    Hi,

    Does anyone know where the ExamineIndex.config and ExamineSettings.config are located in Umbraco 8? I can't find this files.

    Also the Examine Management tab only lists the Indexers. The configured (or not?) searchers aren't listed.

  • Damiaan 438 posts 1290 karma points MVP 3x c-trib
    Mar 04, 2019 @ 21:13
    Damiaan
    0

    I thought examine is now configured in code. The documentation is not yet done as you can see here: https://our.umbraco.com/Documentation/v8documentation

    I would look for components with examine in the name in the source code for now.

  • louisjrdev 107 posts 343 karma points c-trib
    Mar 05, 2019 @ 08:00
  • Michael Argentini 20 posts 130 karma points
    Mar 09, 2019 @ 18:39
    Michael Argentini
    1

    I had the same question. But for the time being, I used the default configured external indexes. In my Umbraco 8 test project, this partial snippet is used for searching content of document type "Quotation":

    // q = search string from an input field
    // Break search into separate terms
    // You should check for null or empty string
    
    var _searchTerms = q.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
    
    // I use a loop here so I can optionally remove noise words and such...
    foreach (var term in _searchTerms)
    {
        searchTerms.Add(term);
    }
    
    if (searchTerms.Length > 0)
    {
        if (!ExamineManager.Instance.TryGetIndex("ExternalIndex", out var index) || !(index is IUmbracoIndex umbIndex))
        { 
            throw new InvalidOperationException($"No index found by name ExternalIndex or is not of type {typeof(IUmbracoIndex)}");
        }
    
        var searcher = umbIndex.GetSearcher();
    
        if (searcher != null)
        {
            var qry = searcher.CreateQuery("", BooleanOperation.And)
                .Field("__NodeTypeAlias", "quotation");
    
            foreach (var term in searchTerms)
            {
                qry = qry.Or().Field("quote", term);
            }
    
            var results = qry.Execute(10);
    
            if (results != null && results.Count() > 0)
            {
                // Process results
            }
        }
    }
    

    Hope this helps while they rework the documentation ;)

  • mcgrph 35 posts 162 karma points
    Apr 27, 2019 @ 20:10
    mcgrph
    1

    This was pretty much what I was looking for. I was failing with TryGetSearcher because there was none, but the way with the index solved it for me!

  • Craig Cronin 303 posts 502 karma points
    May 14, 2019 @ 20:31
    Craig Cronin
    0

    Do you know how to search multiple document types? e.g quotation and others?

  • Michael Argentini 20 posts 130 karma points
    May 14, 2019 @ 22:28
    Michael Argentini
    0

    In my example, try adding query criteria like:

    qry = qry.Or().Field("__NodeTypeAlias", "docTypeAliasHere");
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies