David,-

 which version of Lucene are You using?

Best regards


On 10/21/19 1:31 PM, Shifflett, David [USA] wrote:
Hi all,
Using the code snippet:
     ComplexPhraseQueryParser qp = new ComplexPhraseQueryParser(“somefield”, 
new StandardAnalyzer());
     String teststr = "\"Foo Bar\"~2";
     Query queryToSearch = qp.parse(teststr);
     System.out.println("Query : " + queryToSearch.toString());
     System.out.println("Type of query : " + 
queryToSearch.getClass().getSimpleName());

I am getting the output
     Query : "Foo Bar"~2
     Type of query : ComplexPhraseQuery

If I change teststr to "\"Foo Bar\""
I get
     Query : "Foo Bar"
     Type of query : ComplexPhraseQuery

If I change teststr to "Foo Bar"
I get
     Query : content:foo content:bar
     Type of query : BooleanQuery


In the first two cases I was expecting the search terms to be switched to 
lowercase.

Were the Foo and Bar left as originally specified because the terms are inside 
double quotes?

How can I specify a search term that I want treated as a Phrase,
but also have the query parser apply the LowerCaseFilter?

I am hoping to avoid the need to handle this using PhraseQuery,
and continue to use the QueryParser.


Thanks in advance for any help you can give me,
David Shifflett


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to