def testPrefixQuery(self): parser = QueryParser(Version.LUCENE_CURRENT, "category", StandardAnalyzer(Version.LUCENE_CURRENT)) parser.setLowercaseExpandedTerms(False) print parser.parse("/Computers/technology*").toString("category")
def testLowercasing(self): q = QueryParser(Version.LUCENE_CURRENT, "field", self.analyzer).parse("PrefixQuery*") self.assertEqual("prefixquery*", q.toString("field"), "lowercased") qp = QueryParser(Version.LUCENE_CURRENT, "field", self.analyzer) qp.setLowercaseExpandedTerms(False) q = qp.parse("PrefixQuery*") self.assertEqual("PrefixQuery*", q.toString("field"), "not lowercased")