lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Searching on Multiple fields
Date Sun, 16 Jul 2006 01:49:44 GMT
Currently, my Lucene search code allows the user to specify
which fields are searched ...I have now had a request to enhance
the code to allow the users to specify that certain 
searchfields contain one value and other ( or all other ) fields
contain a different value.
In Luke I can do following to run this type of search:
 +secondarySection:"Vendor Information" +title:types

The relevant section of my code as it currently stands is
as follows: ...
// Is a Lucene FSDir object available
if (fsDir != null) {
    is = new IndexSearcher(fsDir);
    // searchFields are those Lucene fields which I need to search for
the search term
    qp = new MultiFieldQueryParser(searchFields,new StopAnalyzer());
    if (qp != null) {
        // stringToFind is search term I am searching for across all
       query = qp.parse(stringToFind.toUpperCase());
    } // if ( fsDir != null )
Can anyone suggest how I need to proceed to mod this code to allow for 
the new feature requested ...

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message