[ https://issues.apache.org/jira/browse/PYLUCENE-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13029666#comment-13029666 ]
Andi Vajda commented on PYLUCENE-9: ----------------------------------- Are you sure you're comparing the right versions ? Lucene.Net is quite behind Java Lucene and in more recent versions lots of things changed. For instance, trying different Version instances gives different results, notably LUCENE_24 works as you seem to expect: >>> qp = QueryParser(Version.LUCENE_29, "ft", StandardAnalyzer(Version.LUCENE_29)) >>> qp.parse('"Calendar Item as Msg"') <Query: ft:"calendar item ? msg"> <-- the 'as' stop word gets replaced by a hole as expected in that version >>> qp = QueryParser(Version.LUCENE_24, "ft", StandardAnalyzer(Version.LUCENE_24)) >>> qp.parse('"Calendar Item as Msg"') <Query: ft:"calendar item msg"> <-- works as Lucene.Net (probably, as I've never run it) I'm inclined to resolve this bug as INVALID unless I'm missing something here. Please, let me know. > 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