Re: Re: custome index rule

2011-10-24 Thread janwen
thanks,Ian.I will try your idea. 2011-10-24 janwen | China website : http://www.qianpin.com/ From:Ian Lea Date:2011-10-24 18:01 Subject:Re: custome index rule To:java-user Cc: You can achieve pretty much anything by customizing parsers and tokenizers but for your simple case I'd

Re: custome index rule

2011-10-24 Thread Ian Lea
You can achieve pretty much anything by customizing parsers and tokenizers but for your simple case I'd just use String.split() and add the phrases one by one. Something like Document d = ... String[] phrases = sentence,split(","); for (String phrase : phrases) { d.add(new Field("phrase", phras

custome index rule

2011-10-24 Thread janwen
Hi, I want to implement a custom index rule: Assume the sentence like the following:Note comma I am in China,I am in USA,I am in UK I hope lucene index above sentece based on the rule: 1)split the sentence with comma(,),so we get(I am in China)(I am in USA)(I am in UK) 2)then lucene just