lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Jain" <Eric.J...@isb-sib.ch>
Subject Re: Can I do this with Lucene ?
Date Thu, 10 Jul 2003 10:20:59 GMT
> I want to retrieve
> a single faq using a search engine.

You could index FAQs instead of files.

  for file in listFiles():
    for faq in extractFaqs(file):
      doc = Document()
      doc.add(Field.Keyword('key', faq.id))
      doc.add(Field.Keyword('file', file))
      doc.add(Field.Unstored('content', faq.content))
      writer.addDocument(doc)


> I didn't see anything like this in the docs....just something that
> return the number of hits of a search

One solution would be to create a custom HitCollector that simply counts
hits and then 'searcher.search(query, hitCollector)'.

--
Eric Jain


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message