You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Shad Storhaug (JIRA)" <ji...@apache.org> on 2017/06/29 10:29:00 UTC
[jira] [Closed] (LUCENENET-587) Getting ScoreDocs count zero when i
use PhraseQuery
[ https://issues.apache.org/jira/browse/LUCENENET-587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shad Storhaug closed LUCENENET-587.
-----------------------------------
Resolution: Not A Problem
JIRA is for reporting defects with the code and/or tracking work that needs to be completed on the Lucene.Net project.
The appropriate place to ask for user help is on the user mailing list (https://cwiki.apache.org/confluence/display/LUCENENET/Mailing+Lists) or on StackOverflow. You are far more likely to get an answer to your question that way.
> Getting ScoreDocs count zero when i use PhraseQuery
> ---------------------------------------------------
>
> Key: LUCENENET-587
> URL: https://issues.apache.org/jira/browse/LUCENENET-587
> Project: Lucene.Net
> Issue Type: Bug
> Components: .NET API
> Affects Versions: Lucene.Net 3.0.3
> Environment: .net
> Reporter: Veerababu
>
> Right now i am using below code to search.
> MultiFieldQueryParser multiParser = new MultiFieldQueryParser(Lucene.Net.Util.Version.LUCENE_30,
> new[] { "EntityName", "EntityDesc", "EntityTranscript", "CourseSystemID", "Tags", "Objectives" },
> 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.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)