Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@www.apache.org Received: (qmail 67103 invoked from network); 5 Apr 2004 17:10:26 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 5 Apr 2004 17:10:26 -0000 Received: (qmail 73361 invoked by uid 500); 5 Apr 2004 17:10:15 -0000 Delivered-To: apmail-jakarta-lucene-dev-archive@jakarta.apache.org Received: (qmail 73343 invoked by uid 500); 5 Apr 2004 17:10:15 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 73330 invoked from network); 5 Apr 2004 17:10:14 -0000 Received: from unknown (HELO c000.snv.cp.net) (209.228.32.64) by daedalus.apache.org with SMTP; 5 Apr 2004 17:10:14 -0000 Received: (cpmta 8917 invoked from network); 5 Apr 2004 10:10:18 -0700 Received: from 24.51.109.181 (HELO ?192.168.1.100?) by smtp.hatcher.net (209.228.32.64) with SMTP; 5 Apr 2004 10:10:18 -0700 X-Sent: 5 Apr 2004 17:10:18 GMT Mime-Version: 1.0 (Apple Message framework v613) In-Reply-To: <20040405075004.29988.h013.c014.wm@mail.cswebmail.com.criticalpath.net> References: <20040405075004.29988.h013.c014.wm@mail.cswebmail.com.criticalpath.net> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <1D02DBB4-8724-11D8-A938-000393A564E6@ehatchersolutions.com> Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: Search Expansion - more Date: Mon, 5 Apr 2004 13:10:18 -0400 To: "Lucene Developers List" X-Mailer: Apple Mail (2.613) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I really would love to spend some time on this thread, but it is hard for me to carve out time to do by creating my own example. If you could come up with a self-contained example (use RAMDirectory, hard-code strings for indexing a single document, and then your query code) I will be able to look at it more sufficiently. There are too many variables to your equation for me to make sense of via piecemeal e-mail code chunks. You're doing TermQuery's, so that is all about single terms, not phrases. So I'm not clear on how you are even attempting a PhraseQuery with what you've shown. Erik On Apr 5, 2004, at 10:50 AM, hgadm@cswebmail.com wrote: > On Sun, 4 Apr 2004 13:42:45 -0400, Erik Hatcher wrote: >> You could, perhaps, take an easier way out and run > text through an Analyzer as you build up your query, > without using QueryParser. Look, >> again, at my AnalysisDemo code in the java.net >> article.... just pull >> what you need from there to process a TokenStream out >> of an Analyzer. >> >> Erik >> > > Erik, > > I managed to process the tokenStream further but it > does not allow to search for "host defense" > as phrase. > > > Here is what I've done: > (input to the function is by the string array myquery > which contains e.g. myquery[1]="term1", > myquery[2]="host defense") > > > BooleanQuery query = new BooleanQuery(); > > //for each term to add: > for (int j=0; j stream = analyzer.tokenStream("contents", new > StringReader(myquery[j])); > String str = ""; > while (true){ > Token token = stream.next(); > if (token == null) break; > str = str + token.termText() + " "; > } > query.add(new TermQuery(new Term("subject", > str.trim())), false, false); > } > > With this code I tried to assemble single tokens like > "host" and "defense" that are probably coming out of > the analyser back to "host defense" - but it doesn't > find me "host defense" ?? > > Holger :-( > > ___________________________________________________ > The ALL NEW CS2000 from CompuServe > Better! Faster! More Powerful! > 250 FREE hours! Sign-on Now! > http://www.compuserve.com/trycsrv/cs2000/webmail/ > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-dev-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-dev-help@jakarta.apache.org