I've got a lot of persons inside the content tree and I'll create a new index for that. This is for improve the performance of the web application when searching for a specific person.
Create the index
I've made a new index in the examine manager from Umbraco 7.7 named PersonIndexer to index all the persons. This includes only the node types of a person.
For this I've made this code:
ExamineSettings.config
Inside the file ExamineSettings.config inside the Examine → ExamineIndexProviders → providers tag:
var searcher = ExamineManager.Instance.SearchProviderCollection["PersonsSearcher"];
var searchCriteria = searcher.CreateSearchCriteria();
var query = searchCriteria.Field("nodeTypeAlias", "person").Compile();
var searchResults = searcher.Search(query);
Get typed document from an index using Umbraco
What I'll try
I've got a lot of persons inside the content tree and I'll create a new index for that. This is for improve the performance of the web application when searching for a specific person.
Create the index
I've made a new index in the examine manager from Umbraco 7.7 named
PersonIndexer
to index all the persons. This includes only the node types of a person.For this I've made this code:
ExamineSettings.config
Inside the file
ExamineSettings.config
inside theExamine
→ExamineIndexProviders
→providers
tag:And inside the same file I've also added this but inside the
Examine
→ExamineSearchProviders
→providers
tag:ExamineIndex.config
Inside the file
ExamineIndex.config
inside theExamineLuceneIndexSets
tag:Get the documents
When I build this index, it got 7 documents inside the index.
How can I get all this documents inside my view. I've tried this code:
This gives me all properties of that index.
The question
This isn't what I need. So my question is: How could I get the typed documents from that index?
P.S.: Click on images for original size
Found it. I'm using this code now:
and edited the
IndesSet
to this:Continued here: Get typed results for examine indexer using Umbraco
is working on a reply...