lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spinergywmy <>
Subject Re: how to search string with words
Date Tue, 21 Nov 2006 11:27:36 GMT

Hi Erick,

   I did take a look at the link that u provided me, and I have try myself
but I have no return reesult.

   My search string is "third party license readme"

   Below r the codes that I wrote, please point me out where I have done

      readerA =;
			readerB =;
			//building the searchables
	        Searcher[] searchers = new Searcher[2];
	        // VITAL STEP:adding the searcher for the empty index first, before
the searcher for the populated index
	        searchers[0] = new IndexSearcher(readerA);
	        searchers[1] = new IndexSearcher(readerB);
			Analyzer analyzer = new StandardAnalyzer();
			QueryParser parser = new QueryParser(DsConstant.idxFileContent,

      SpanTermQuery stq = new SpanTermQuery(new Term(field,
buff.toString())); //field = search base on what I have index
				SpanFirstQuery sfq = new SpanFirstQuery(stq, searchString1.length);
//searchString1 = "third party license readme"
				sfq = (SpanFirstQuery) sfq.rewrite(readerA);
				sfq = (SpanFirstQuery) sfq.rewrite(readerB);
				//creating the multiSearcher
		        Searcher mSearcher = getMultiSearcherInstance(searchers);
				searchHits =;

   The sysout as below:

      span first query is ::: spanFirst(TestC:TestC:Third Party License
Readme, 32)
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message