[ 
https://issues.apache.org/jira/browse/PYLUCENE-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031272#comment-13031272
 ] 

Andi Vajda commented on PYLUCENE-9:
-----------------------------------

So I wrote this simple class, foo:

import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.util.Version;

public class foo {
    static void parse(Version version)
        throws org.apache.lucene.queryParser.ParseException
    {
        System.out.println(
            version + " " + 
            new QueryParser(version, "ft", new StandardAnalyzer(version))
            .parse("\"Calendar Item as Msg\""));
    }
        
    static public void main(String[] args)
        throws org.apache.lucene.queryParser.ParseException
    {
        parse(Version.LUCENE_24);
        parse(Version.LUCENE_29);
        parse(Version.LUCENE_30);
        parse(Version.LUCENE_CURRENT);
    }
}

I then compiled it against the lucene-3.0.3 jar:
  $ javac -cp lucene-java-3.0.3/build/lucene-core-3.0.3.jar foo.java
and then ran it against the same jars:
 $ java -cp lucene-java-3.0.3/build/lucene-core-3.0.3.jar:. foo
LUCENE_24 ft:"calendar item msg"
LUCENE_29 ft:"calendar item ? msg"
LUCENE_30 ft:"calendar item ? msg"
LUCENE_CURRENT ft:"calendar item ? msg"

As you can see, the same behavior is seen without PyLucene, just plain java. 
The parsing behavior you expect seems to happen only with Version.LUCENE_24. 
Please, send java code (as PyLucene seems out of the picture for now), that 
reproduces the problem.

> QueryParser replacing stop words with wildcards
> -----------------------------------------------
>
>                 Key: PYLUCENE-9
>                 URL: https://issues.apache.org/jira/browse/PYLUCENE-9
>             Project: PyLucene
>          Issue Type: Bug
>         Environment: Windows XP 32-bit Sp3, Ubuntu 10.04.2 LTS i686 
> GNU/Linux, jdk1.6.0_23
>            Reporter: Christopher Currens
>
> Was using query parser to build a query.  In Java Lucene (as well as 
> Lucene.Net), the query "Calendar Item as Msg" (quotes included), is parsed 
> properly as FullText:"calendar item msg" in Java Lucene and Lucene.Net.  In 
> pylucene, it is parsed as: FullText:"calendar item ? msg".  This causes 
> obvious problems when comparing search results from python, java and .net.
> Initially, I thought it was the Analyzer I was using, but I've tried the 
> StandardAnalyzer and StopAnalyzer, which work properly in Java and .Net, but 
> not pylucene.
> Here is code I've used to reproduce the issue:
> >>> from lucene import StandardAnalyzer, StopAnalyzer, QueryParser, Version
> >>> analyzer = StandardAnalyzer(Version.LUCENE_30)
> >>> query = QueryParser(Version.LUCENE_30, "FullText", analyzer)
> >>> parsedQuery = query.parse("\"Calendar Item as Msg\"")
> >>> parsedQuery
> <Query: FullText:"calendar item ? msg">
> >>> analyzer = StopAnalyzer(Version.LUCENE_30)
> >>> query = QueryParser(Version.LUCENE_30)
> >>> parsedQuery = query.parse("\"Calendar Item as Msg\"")
> >>> parsedQuery
> <Query: FullText:"calendar item ? msg">
> I've noticed this in pylucene 2.9.4, 2.9.3, and 3.0.3

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to