I have since learned that using the TermQuery instead of the MultiFieldQueryParser 
works for the keyword field in question below (HW-NCI_TOPICS).
 
apiQuery = new BooleanQuery();
apiQuery.add(new TermQuery(new Term("category", "HW-NCI_TOPICS")), true, false);
 
This finds a match.
 
I found a message that talked about having to use the the Query API when searching 
Keyword fields in the index.  Is this true?
 
Is there not a way to get the MultiFieldQueryParser to find a match on this keyword?
 
thanks,
chad.

        -----Original Message----- 
        From: Chad Small 
        Sent: Tue 3/23/2004 10:57 AM 
        To: [EMAIL PROTECTED] 
        Cc: 
        Subject: Query syntax on Keyword field question
        
        

        Hello,
        
        How can I format a query to get a hit?
        
        I'm using the StandardAnalyzer() at both index and search time.
        
        If I'm indexing a field like this:
        
        luceneDocument.add(Field.Keyword("category","HW-NCI_TOPICS"));
        
        I've tried the following with no success:
        
        //      String searchArgs = "HW\\-NCI_TOPICS";
        //      String searchArgs = "HW\\-NCI_TOPICS".toLowerCase();
        //      String searchArgs = "+HW+NCI+TOPICS";
              //this works with .Text field
        //      String searchArgs = "+hw+nci+topics";
        //      String searchArgs = "hw nci topics";
        
        thanks,
        chad.
        

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

Reply via email to