Otis, I think MultiFieldQueryParser (if I am not mistaken) uses the same query string to search multiple fields. Let me know if it is otherwise.
Erik, Let me see if I can answer those questions. Here are some code snippets, by the way. FOR INDEX IndexWriter writer = new IndexWriter(indexDir, new StopAnalyzer(), true); while (rs.next()){ //rs is a database resultset I am looping over Document doc = new Document(); doc.add(Field.Keyword("ObjectID", ObjectID)); doc.add(Field.Keyword("ImageExistsBit", ImageExistsBit));//ImageExistsBit is 1 or 0 doc.add(Field.Text("SearchTerms", SearchTerms)); writer.addDocument(doc); writer.optimize(); writer.close(); } FOR SEARCH searcher = new IndexSearcher(IndexReader.open(indexPath) ); Analyzer analyzer = new StopAnalyzer(); luceneQuery = QueryParser.parse(queryString, "SearchTerms", analyzer); hits = searcher.search(luceneQuery); System.out.println("Found " + hits.length() + " document(s)."); What I want: I want all the ObjectIDs that have the term 'visnu temple' in the SearchTerms field and has ImageExistsBit=1. So the queryString above is: SearchTerms:\"visnu temple\" ImageExistsBit:1". The .toString() for this query is SearchTerms:"visnu temple" Thanks, George On 6/22/05, Otis Gospodnetic <[EMAIL PROTECTED]> wrote: > George, > > You can use MultiFieldQueryParser instead of QueryParser. > > Otis > > > --- George Abraham <[EMAIL PROTECTED]> wrote: > > > All, > > Forgive me for the basic question. When you are querying multiple > > fields using QueryParser, what is the exact code? > > > > I tried QueryParser.parse(queryString, "SearchTerms", analyzer) where > > queryString was "SearchTerms:visnu temple ImageExistsBit:1", > > SearchTerms and ImageExistsBit being the two fields I want searched. > > However it does not seem to do what I want it to do. > > > > TIA, > > George > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]