lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chaminda Amarasinghe <amcainfor...@yahoo.com>
Subject Need a help
Date Sat, 10 Mar 2007 11:49:21 GMT
Hi all,
   
  I'm new to this group,
   
  I'm using lucene for indexing. I have a problem. Any help gratly appreciate.
   
  Please see the following code
  // three fields
  MultiFieldQueryParser parser = new MultiFieldQueryParser(new String[]{"title", "tags", "content"},
new StandardAnalyzer());
  // OR operator
        parser.setDefaultOperator(QueryParser.Operator.OR);
  // first step : search in lucene indexes
        IndexSearcher searcher = new IndexSearcher(eventsBothDirectory)
   
  // searchString is a String with many words
  Query lquery = parser.parse(searchString);

  //new QueryParser("content", new StandardAnalyzer());
Hits hits = searcher.search(lquery);
   
  How can I find the matched words in searchString.
  for a example
  will say the searchString="wordone wordtwo wordthree". there are some hits for "wordone"
and "wordthree". but no hits for "wordtwo". 
  So what I want is to get "wordone" and "wordthree". (results are available only for "wordone"
and "wordthree". ).(I hope question is clear now)
  How can i get this with lucene.
   
  Many thanks.
  Chaminda Amarasighe

 
---------------------------------
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message