Dear all,
I am using the following code to search indexed data. However, when
the searchKeyword contains some special characters, such as "//", ":",
"+", "-", ".", and even digital numbers, the query removes some
required characters or splits the keyword. Sometimes, it causes no
results although I am sure the results exist. May I cancel the feature
so that the query does not change my original searchKeyword?
......
IndexSearcher searcher = new IndexSearcher(fsDirectory);
Analyzer chineseAnalyzer = new ChineseAnalyzer();
QueryParser queryParser = new QueryParser(searchField, chineseAnalyzer);
Query query =
queryParser.Parse(DBTools.FilterKeyFieldValue(searchKeyword));
Hits results = searcher.Search(query);
......
Thanks so much!
LB