On Friday, November 7, 2003, at 03:56 AM, Victor Hadianto wrote:
Nonetheless, both "creator" and the name of the
creator are variables.  We depend on the user to give

Of course, but you don't have unlimited fields right? So you know that "creator" field is the creator of a book. You can provide the user with complicated UI but internally you can build your own query.

Query query = QueryParser.parse("creator:\"Elizabeth
Castro\" AND category:\"Computer Science\"",
"creator" AND "category",  // Is this right?
new StandardAnalyzer());
indexSearcher.search(query);


I recommend against code generated String's to be QueryParse'd. There are far too many fiddly issues with QueryParser (my java.net article on this very subject should be coming today or very very soon). Use Lucene's Query API to construct queries in code - and doing so dynamically from a sophisticated search UI would not be that much more work yet would avoid several awkward issues in the parsing process.


Erik


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to