Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
Lucene.Net 3.0.3
-
None
-
None
-
.net
Description
Right now i am using below code to search.
MultiFieldQueryParser multiParser = new MultiFieldQueryParser(Lucene.Net.Util.Version.LUCENE_30,
new[]
,
new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_30));
if (searchTerm.Contains("\""))
{ multiParser.DefaultOperator = QueryParser.Operator.AND; }else
{ multiParser.DefaultOperator = QueryParser.Operator.OR; } string parserTerm = ReplaceSpecialCharactersInSearchTerm(searchTerm);
searchResults.Clear();
// parse the query
Query query = multiParser.Parse(parserTerm);
TopDocs results = searcher.Search(query, 20000);
Above code is working fine form , but if i give "Dynamcis 365 Enterprise" as search keyword it is bring resutls for each and every work match like , Dynamics word ,365 word match and Enterprise match. But my requirement is exact string("Dynamcis 365 Enterprise") match.
To achieve this i have changed my code from parser to phrase query. But it is giving ScoreDocs count Zero.
Please hlep me on this how to achieve.