Hi, all, I create a chinese website using umbraco, and implement the search function with umbraco examine. To search the chinese content, I change the analyzer to Lucene.Net.Analysis.Cn.ChineseAnalyzer, like bellow:
but when I open the website, I got a server error:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing
of a configuration file required to service this request. Please review
the specific error details below and modify your configuration file
appropriately.
Parser Error Message: Value cannot be null. Parameter name: type
Source Error:
Line 11: <providers>
Line 12: <add name="ForumEntryIndexer"
Line 13: type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
Line 14: dataService="UmbracoExamine.DataServices.UmbracoDataService, UmbracoExamine"
Line 15: indexSet="ForumEntrySet"
Could anyone kindly tell me how to deal with this issue?
Do you have the dll for the analyzer in your bin folder ? Because Lucene.Net.Analysis.Cn.ChineseAnalyzer is not in the Lucene.Net dll provided by Umbraco.
Thanks for your reply, you are right, after building the Lucene.Net.Analysis.Cn and copying the dll to the bin folder, the error don't display anymore. But I have another issue, I still can't search the chinese content, and the english cotent still can be searched out?
Is it possible to use the StandardAnalyzer for Chinese? I have a 1-1 multilingual website that uses Vorto. So the same node has English and Chinese content which means we can't change the analyzer.
Use Lucene to search Chinese website
Hi, all, I create a chinese website using umbraco, and implement the search function with umbraco examine. To search the chinese content, I change the analyzer to Lucene.Net.Analysis.Cn.ChineseAnalyzer, like bellow:
but when I open the website, I got a server error:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Value cannot be null.
Parameter name: type
Source Error:
Could anyone kindly tell me how to deal with this issue?
Do you have the dll for the analyzer in your bin folder ? Because Lucene.Net.Analysis.Cn.ChineseAnalyzer is not in the Lucene.Net dll provided by Umbraco.
Dave
hi, Dave,
Thanks for your reply, you are right, after building the Lucene.Net.Analysis.Cn and copying the dll to the bin folder, the error don't display anymore. But I have another issue, I still can't search the chinese content, and the english cotent still can be searched out?
PS: I get the ChineseAnalyzer code from https://svn.apache.org/repos/asf/lucene.net/tags/Lucene.Net_2_9_4_RC3/src/contrib/Analyzers/Cn/
can you post both your examine config files ?
Dave
Oh, thank you very much for such quick reply, I have changed my examine searcher and indexer in the ExamineSettings.config, See below:
<ExamineSearchProviders defaultProvider="ExternalSearcher"> <providers> <add name="ForumEntrySearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" indexSet="ForumEntrySet" analyzer="Lucene.Net.Analysis.Cn.ChineseAnalyzer, Lucene.Net.Analysis.Cn" /> <add name="InternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/> <add name="ExternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net" enableLeadingWildcards="true"/> <add name="InternalMemberSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" enableLeadingWildcards="true"/> </providers> </ExamineSearchProviders> </Examine>
All seems okay here. Can you post your search code ?
Dave
public IEnumerable<ForumPost> SearchPosts(string searchTerm)
{
var criteria = ExamineManager.Instance.SearchProviderCollection["ForumEntrySearcher"].CreateSearchCriteria();
var query = criteria.GroupedOr(new string[] { "nodeName", "forumPostContent"}, searchTerm).And().NodeTypeAlias("ForumPost"");
var results = ExamineManager.Instance.SearchProviderCollection["ForumEntrySearcher"].Search(query.Compile());
return results.Select(searchResult => Mapper.MapForumPost(searchResult)).OrderByDescending(x => x.CreatedOn);
}
Did you create a entry in ExameIndex.config for the index ?
If yes. Try using luke for checking if you index is being populated
Ok, I will have a try, thanks, Dave
Hello,
Is it possible to use the StandardAnalyzer for Chinese? I have a 1-1 multilingual website that uses Vorto. So the same node has English and Chinese content which means we can't change the analyzer.
Jeroen
I could index the same content twice in different indexes with different analyzers, but it isn't ideal. Any other solutions?
Jeroen
We're building a faceted search based on this 24 days blogpost: http://24days.in/umbraco/2014/search-with-bobo/
In there a QueryParser is used and there you can pass the analyzer as a querystring. So I can use 1 index and change the analyzer in the code.
Jeroen
I think you may find it easier/better to have 2 index one for chinese and one for the others obviously that's a bit nastier for maintenence.
i think with fuzzy searches because of the way chinese is written it is hard for the pattern matching to work correctly.. Ravi
is working on a reply...