
ian.lea at gmail
Aug 17, 2012, 5:55 AM
Post #2 of 4
(263 views)
Permalink
|
|
Re: Find documents contained in search term
[In reply to]
|
|
Can't see how you could do it with standard queries, but you could reverse the process and use a MemoryIndex. Add the single target phrase to the memory index then loop round all docs executing a search for each one. Maybe use PrefixQuery although I'd worry about performance. Try it and see. But if you're just doing string comparison for each doc { if target.startsWith(doc.text) { // match } } might be easier. -- Ian. On Thu, Aug 16, 2012 at 6:38 PM, davidbrai <davidbrai [at] gmail> wrote: > Hi, > > I have a situation in which I have many short documents (30-400 chars). > My goal is given a phrase, find an indexed document which is a prefix of the > phrase. > Is there a way to achieve this goal using lucene using a single query? > > Thanks, > David. > > > > -- > View this message in context: http://lucene.472066.n3.nabble.com/Find-documents-contained-in-search-term-tp4001663.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe [at] lucene > For additional commands, e-mail: java-user-help [at] lucene > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe [at] lucene For additional commands, e-mail: java-user-help [at] lucene
|