Copied to clipboard

Flag this post as spam?

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


  • Andrew McDonald 8 posts 31 karma points
    May 28, 2017 @ 11:39
    Andrew McDonald
    0

    Targeting your own custom Examine index

    I can't see any example of how to do this with Linq to Examine

    Instead of doing something like: var index = new Index

    How can you instead use your own custom Examine index ?

  • Craig Noble 41 posts 584 karma points c-trib
    May 28, 2017 @ 22:35
    Craig Noble
    0

    Hi Andrew

    You can pass the name of the searcher into the constructor of Index. That'll allow you to query your custom index :)

    Thanks Craig

  • Sven Vervloet 10 posts 81 karma points
    May 22, 2018 @ 10:51
    Sven Vervloet
    0

    Hi. I know this is an old question, but a custom Searcher doesn't seem to work in my case.

    I am in progress of porting a lot of content from a custom CMS to Umbraco. The site is multilingual.

    I have a custom indexer, searcher, indexSet per language. Everything is indexed trough the backoffice. When I do a regular Lucene search, I get the needed results, but not with LINQ To Examine.

    What works:

                    var searchProvider = "MySearchSearcher" + language;
                var searcher = ExamineManager.Instance.SearchProviderCollection[searchProvider];
                var sc = searcher.CreateSearchCriteria();
    
                var query = sc.NodeTypeAlias("project");
                var results = searcher.Search(query.Compile());
    

    What doesn't work:

    var searchProvider = "MySearchSearcher" + language;
    
                var results = new Index<Project>(searchProvider).ToList();
    

    Everything seems to be in order with my model. When I do not enter a searcherName, I do get results.

    I can not use the ExternalSearcher, because every content node has a LegacyId (Id from the old CMS). The same legacyId exists on every language. I have to search for the content node of a certain DocType that matches the legacyId and then set relations between them. The relations are language dependent.

Please Sign in or register to post replies

Write your reply to:

Draft