lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36296] New: - setPhraseSlop return the same results irrespective of int parameter
Date Mon, 22 Aug 2005 09:05:33 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36296>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36296

           Summary: setPhraseSlop return the same results irrespective of
                    int parameter
           Product: Lucene
           Version: 1.4
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P3
         Component: QueryParser
        AssignedTo: java-dev@lucene.apache.org
        ReportedBy: adhotre@ctepl.com
                CC: adhotre@ctepl.com


Please help me for my requirement to have a similiar word search functionality 
using Lucene.

Read about slop in Lucene FAQ [Is there a way to use a proximity operator (like 
near or within) with Lucene?] and tried to implement the same.

Calling setPhraseSlop on QueryParser class gives me the same results with 
different querytext values(querytext 1:"Anil Dhotre", querytext 2: "Dhotre 
Anil"). 

The result of search is always hit count equals to 1. Correct result should 
give me hit count 0 when i give querytext "Dhotre Anil" with the 0 slop value 
of QueryParser.
 
Following is code snippet.

QueryParser queryParser = new QueryParser("default", DEFAULT_ANALYZER);
queryParser.setPhraseSlop(0);
System.out.println("Slop : " + queryParser.getPhraseSlop());
Query query = queryParser.parse("Anil Dhotre","data",DEFAULT_ANALYZER) ;
Hits hits = searcher.search(query);

Note: index includes "Anil Dhotre" as part of indexed data.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message