lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shad Storhaug (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (LUCENENET-587) Getting ScoreDocs count zero when i use PhraseQuery
Date Thu, 29 Jun 2017 10:29:00 GMT

     [ 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)

Mime
View raw message