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.
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 ?
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
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:
What doesn't work:
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.
is working on a reply...