I " Lucene " " Umbraco " content, lifting it What is the easiest way to walk?
I tried to use the easy search "Lucene Cover",
it is working, but I'm not getting any results from the query, I try to remove test index / App_Data / TEMP
but do not create Umbraco new ExamineIndexes file
I am using Umbraco version 7.1.8
c #
I
check
is Lucene
implementation for Umbraco.
From the following steps, you should help you search with Examine
and Umbraco:
Create an index
To create a searchable index, we need to create 3 things: an indicator and a searcher set.
-
Open ~ / Config /ExamineSettings.config and add an inde 'ExamineIndexProviders / Xer under the providers section (in this example it is ExternalIndexer name):
& lt; Adding name = "ExternalIndexer" type = "UmbracoExamine.UmbracoContentIndexer, UmbracoExamine" />
-
Adding a searcher under the same file (~ / config / ExamineSettings.config) 'ExamineSearchProviders / Providers section (in this example it is named ExternalSearcher) :
& lt; Adding name = "ExternalSearcher" type = "UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" />
- In
-
We will change the default search provider to the one created by us, set
defaultProvider = "ExternalSearcher"
-
Open ~ / Config /ExamineIndex.config and add an index set (in this example it is named
< P>ExternalIndexSet
):& lt; IndexSet SetName = "ExternalIndexSet" IndexPath = "~ / App_Data / TEMP / ExamineIndexes / External /" />
Checking is a searchable index that we have configured to check that the index file is not present on the system, so the application startup The index will be rebuilt during Once this happens the index will automatically remain up to date with the data in Umbraco.
Searching with razors
There is a search
method in the razor macro there is DynamicNode
model that is a < Code> will return DynamicNodeList : (! String.IsNullOrEmpty (Request.QueryString ["query"]))
@if {& lt; Ul & gt; @foreach (The result in Wambreco (search .jQuery string ["query"])) {& lt; Li & gt; & Lt; A href = "@ result.Url" & gt; @ Results. Name & lt; / A & gt; & Lt; / Li & gt; } & Lt; / Ul & gt; }
Comments
Post a Comment