I am facing the following problem on a production environment. Recently i create a custom ISimpleDataService class which collects data from custom tables in database. I have also create the examine config settings as follows:
The problem that i am facing is when i add on the searcher tool a city or country name in english (for example London), then i am getting results, when i add the name in Greek i am not getting. I am sure that the Greek name exists because the ISimpleDataService returns the Greek names also from the database custom tables.
Any help please? It is urgent as this is a production environment.
Hi, thank you for the reply. I found that the problem was in the searchCriteria and the compiled query. For some reason that i cannot understand using the following part of code it didn't work
var searcher = ExamineManager.Instance.SearchProviderCollection["ArtTravelCountriesCitiesSearcher"];
var searchCriteria = searcher.CreateSearchCriteria(Examine.SearchCriteria.BooleanOperation.Or);
var query = searchCriteria.GroupedOr(new string[] { "Name" }, searchTerm);
or
var query = searchCriteria.Field("Name", searchTerm);
var searchResults = searcher.Search(query.Compile()).OrderByDescending(x => x.Score).TakeWhile(x => x.Score > 0.05f);
but using the following code it works
var searcher = ExamineManager.Instance.SearchProviderCollection["ArtTravelCountriesCitiesSearcher"];
var searchResults = searcher.Search(searchTerm, true).OrderByDescending(x => x.Score);
Examine with Custom DB does not search Greek
Hi,
I am facing the following problem on a production environment. Recently i create a custom ISimpleDataService class which collects data from custom tables in database. I have also create the examine config settings as follows:
and
and the indexset is
The problem that i am facing is when i add on the searcher tool a city or country name in english (for example London), then i am getting results, when i add the name in Greek i am not getting. I am sure that the Greek name exists because the ISimpleDataService returns the Greek names also from the database custom tables.
Any help please? It is urgent as this is a production environment.
Regards
Thomas
Can you post your code for your dataservice ?
dave
Hi, thank you for the reply. I found that the problem was in the searchCriteria and the compiled query. For some reason that i cannot understand using the following part of code it didn't work
var searcher = ExamineManager.Instance.SearchProviderCollection["ArtTravelCountriesCitiesSearcher"]; var searchCriteria = searcher.CreateSearchCriteria(Examine.SearchCriteria.BooleanOperation.Or);
var query = searchCriteria.GroupedOr(new string[] { "Name" }, searchTerm); or var query = searchCriteria.Field("Name", searchTerm);
var searchResults = searcher.Search(query.Compile()).OrderByDescending(x => x.Score).TakeWhile(x => x.Score > 0.05f);
but using the following code it works
var searcher = ExamineManager.Instance.SearchProviderCollection["ArtTravelCountriesCitiesSearcher"]; var searchResults = searcher.Search(searchTerm, true).OrderByDescending(x => x.Score);
Glad to see you got it solved. But still interested in the dataservice code. Maybe this can come in useful for myself at some point.
Dave
Following is the source from the DataService
public class ArtTravelCountriesCitiesService : ISimpleDataService { public IEnumerable
is working on a reply...