Java Mailing List Archive

http://www.java2.5341.com/

Home » java-user.lucene »

Question about QueryParser

j.L

2008-10-23

Replies: Find Java Web Hosting

Author LoginPost Reply
public class AnalyzerTest {
 @Test
 public void test() throws ParseException {
    QueryParser parser = new MultiFieldQueryParser(new String[]{"title",
"body"}, new StandardAnalyzer());
    Query query1 = parser.parse("中文");
    Query query2 = parser.parse("中 文");
    System.out.println(query1);
    System.out.println(query2);
 }
}


output :

title:"中 文" body:"中 文"
(title:中 body:中) (title:文 body:文)



why they not same?



--
regards
j.L
©2008 java2.5341.com - Jax Systems, LLC, U.S.A.