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 wrong. readerA = IndexReader.open(DsConstant.indexDir); readerB = IndexReader.open(DsConstant.idxCompDir); //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, analyzer); 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 = mSearcher.search(sfq); The sysout as below: span first query is ::: spanFirst(TestC:TestC:Third Party License Readme, 32) -- View this message in context: http://www.nabble.com/how-to-search-string-with-words-tf2668490.html#a7469644 Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]