I have viewed all the Umbraco TV videos on the Examine search and still having problems with my search return.
Basically I'm trying to exclude some nodes from the search, but when I perform the search ALL the nodes are returned that match the serach term.
Here is my files:
EXAMINEINDEX.CONFIG:
<?xml version="1.0"?> <!-- Umbraco examine is an extensible indexer and search engine. This configuration file can be extended to create your own index sets. Index/Search providers can be defined in the UmbracoSettings.config
More information and documentation can be found on CodePlex: http://umbracoexamine.codeplex.com --> <ExamineLuceneIndexSets> <!-- The internal index set used by Umbraco back-office - DO NOT REMOVE --> <IndexSet SetName="InternalIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/Internal/"> <IndexAttributeFields> <add Name="id" /> <add Name="nodeName" /> <add Name="updateDate" /> <add Name="writerName" /> <add Name="path" /> <add Name="nodeTypeAlias" /> <add Name="parentID" /> </IndexAttributeFields> <IndexUserFields /> <IncludeNodeTypes> <add Name="FAQ" /> </IncludeNodeTypes> <ExcludeNodeTypes> <add Name="Image" /> </ExcludeNodeTypes> </IndexSet>
<!-- The internal index set used by Umbraco back-office for indexing members - DO NOT REMOVE --> <IndexSet SetName="InternalMemberIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/InternalMember/"> <IndexAttributeFields> <add Name="id" /> <add Name="nodeName"/> <add Name="updateDate" /> <add Name="writerName" /> <add Name="loginName" /> <add Name="email" /> <add Name="nodeTypeAlias" /> </IndexAttributeFields> <IndexUserFields/> <IncludeNodeTypes><add Name="Image" /></IncludeNodeTypes> <ExcludeNodeTypes/> </IndexSet>
<?xml version="1.0"?> <!-- Umbraco examine is an extensible indexer and search engine. This configuration file can be extended to add your own search/index providers. Index sets can be defined in the ExamineIndex.config if you're using the standard provider model.
More information and documentation can be found on CodePlex: http://umbracoexamine.codeplex.com --> <Examine> <ExamineIndexProviders> <providers> <add name="InternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine" supportUnpublished="true" supportProtected="true" interval="10" analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>
@* Get the search term from query string *@ @{var searchTerm = Request.QueryString["search"];} @{var results = ExamineManager.Instance.Search(searchTerm, true); }
Using examine search
Hi
I have viewed all the Umbraco TV videos on the Examine search and still having problems with my search return.
Basically I'm trying to exclude some nodes from the search, but when I perform the search ALL the nodes are returned that match the serach term.
Here is my files:
EXAMINEINDEX.CONFIG:
<?xml version="1.0"?>
<!--
Umbraco examine is an extensible indexer and search engine.
This configuration file can be extended to create your own index sets.
Index/Search providers can be defined in the UmbracoSettings.config
More information and documentation can be found on CodePlex: http://umbracoexamine.codeplex.com
-->
<ExamineLuceneIndexSets>
<!-- The internal index set used by Umbraco back-office - DO NOT REMOVE -->
<IndexSet SetName="InternalIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/Internal/">
<IndexAttributeFields>
<add Name="id" />
<add Name="nodeName" />
<add Name="updateDate" />
<add Name="writerName" />
<add Name="path" />
<add Name="nodeTypeAlias" />
<add Name="parentID" />
</IndexAttributeFields>
<IndexUserFields />
<IncludeNodeTypes>
<add Name="FAQ" />
</IncludeNodeTypes>
<ExcludeNodeTypes>
<add Name="Image" />
</ExcludeNodeTypes>
</IndexSet>
<!-- The internal index set used by Umbraco back-office for indexing members - DO NOT REMOVE -->
<IndexSet SetName="InternalMemberIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/InternalMember/">
<IndexAttributeFields>
<add Name="id" />
<add Name="nodeName"/>
<add Name="updateDate" />
<add Name="writerName" />
<add Name="loginName" />
<add Name="email" />
<add Name="nodeTypeAlias" />
</IndexAttributeFields>
<IndexUserFields/>
<IncludeNodeTypes><add Name="Image" /></IncludeNodeTypes>
<ExcludeNodeTypes/>
</IndexSet>
<IndexSet SetName="MySiteIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/MySite/">
<IndexAttributeFields>
<add Name="nodeTypeAlias" />
</IndexAttributeFields>
<IndexUserFields>
<add Name="bodyText" />
<add Name="staffTitle" />
</IndexUserFields>
<IncludeNodeTypes>
<add Name="Page" />
<add Name="RecipeContainer" />
<add Name="Recipe" />
<add Name="uBlogsyPost" />
</IncludeNodeTypes>
<ExcludeNodeTypes>
<add Name="ExternalLink" />
<add Name="Frontpage" />
<add Name="Lang" />
<add Name="MainMaster" />
<add Name="Error404" />
<add Name="Sitemap" />
<add Name="Image" />
</ExcludeNodeTypes>
</IndexSet>
</ExamineLuceneIndexSets>
EXAMINESETTINGS.CONFIG
<?xml version="1.0"?>
<!--
Umbraco examine is an extensible indexer and search engine.
This configuration file can be extended to add your own search/index providers.
Index sets can be defined in the ExamineIndex.config if you're using the standard provider model.
More information and documentation can be found on CodePlex: http://umbracoexamine.codeplex.com
-->
<Examine>
<ExamineIndexProviders>
<providers>
<add name="InternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="true"
supportProtected="true"
interval="10"
analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>
<add name="InternalMemberIndexer" type="UmbracoExamine.UmbracoMemberIndexer, UmbracoExamine"
supportUnpublished="true"
supportProtected="true"
interval="10"
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>
<add name="MySiteIndexer"
type="UmbracoExamine.LuceneExamineIndexer, UmbracoExamine"
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>
</providers>
</ExamineIndexProviders>
<ExamineSearchProviders defaultProvider="InternalSearcher">
<providers>
<add name="InternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>
<add name="InternalMemberSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" enableLeadingWildcards="true"/>
<add name="MySiteSearcher"
type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"/>
</providers>
</ExamineSearchProviders>
</Examine>
Could anyone help please?
Thanks
I think the problem is how do you performance a search, not how do you index the data.
So if you can post the code you used, that would be better.
Do you mean this bit?
@using Examine;
@* Get the search term from query string *@
@{var searchTerm = Request.QueryString["search"];}
@{var results = ExamineManager.Instance.Search(searchTerm, true); }
@{if (results.TotalItemCount == 0)
{
<p>No results found</p>
}
else
{
<ul class="search-results">
@foreach (var result in results)
{
<li>
@result.Fields["nodeTypeAlias"]
<a href="@umbraco.library.NiceUrl(result.Id)">
@result.Fields["nodeName"]
</a>
</li>
}
</ul>
}
}
Hello Lee,
I faced the same problem with no luck, but here is a workaround (in my case I only want to return result of document type "Photo")
@{
var allresults = ExamineManager.Instance.Search(searchTerm, true);
var results = allresults.Where(a => a.Fields["nodeTypeAlias"] == "umbGalleryPhoto");
}
I wish there is some solution for this issue
Hi all,
Just add the SearchProviderCollection name you defined in the ExamineSetting.config as bellow and you are good to go.
Regards,
mkariti
is working on a reply...