portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jf...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/search/lucene LuceneSearchService.java
Date Fri, 05 Mar 2004 03:49:15 GMT
jford       2004/03/04 19:49:15

  Modified:    src/java/org/apache/jetspeed/services/search/lucene
                        LuceneSearchService.java
  Log:
  Populate field map, content field
  
  Revision  Changes    Path
  1.10      +18 -12    jakarta-jetspeed/src/java/org/apache/jetspeed/services/search/lucene/LuceneSearchService.java
  
  Index: LuceneSearchService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/search/lucene/LuceneSearchService.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- LuceneSearchService.java	27 Feb 2004 21:55:04 -0000	1.9
  +++ LuceneSearchService.java	5 Mar 2004 03:49:15 -0000	1.10
  @@ -23,6 +23,7 @@
   import javax.servlet.ServletConfig;
   import java.util.Collection;
   import java.util.ArrayList;
  +import java.util.HashMap;
   import java.util.Iterator;
   import java.util.Map;
   import java.util.Set;
  @@ -276,16 +277,17 @@
                   result.setKey(doc.getField(ParsedObject.FIELDNAME_KEY).stringValue());
                   result.setDescription(doc.getField(ParsedObject.FIELDNAME_DESCRIPTION).stringValue());
                   result.setTitle(doc.getField(ParsedObject.FIELDNAME_TITLE).stringValue());
  -				Field language = doc.getField(ParsedObject.FIELDNAME_LANGUAGE);
  -				if (language != null)
  -				{
  -					result.setLanguage(language.stringValue());
  -				}
  -				Field classname = doc.getField(ParsedObject.FIELDNAME_CLASSNAME);
  -				if (classname != null)
  -				{
  -					result.setClassName(classname.stringValue());
  -				}
  +                result.setContent(doc.getField(ParsedObject.FIELDNAME_CLASSNAME).stringValue());
  +                Field language = doc.getField(ParsedObject.FIELDNAME_LANGUAGE);
  +                if (language != null)
  +                {
  +                	result.setLanguage(language.stringValue());
  +                }
  +                Field classname = doc.getField(ParsedObject.FIELDNAME_CLASSNAME);
  +                if (classname != null)
  +                {
  +                	result.setClassName(classname.stringValue());
  +                }
                   Field url = doc.getField(ParsedObject.FIELDNAME_URL);
                   if (url != null)
                   {
  @@ -320,15 +322,18 @@
           {
               MultiMap multiKeywords = new MultiHashMap();
               MultiMap multiFields = new MultiHashMap();
  +            HashMap fieldMap = new HashMap();
               
               Field classNameField = doc.getField(ParsedObject.FIELDNAME_CLASSNAME);
               if(classNameField != null)
               {
                   String className = classNameField.stringValue();
  +                o.setClassName(className);
                   ObjectHandler handler = HandlerFactory.getHandler(className);
                   
                   Set fields = handler.getFields();
                   addFieldsToMap(doc, fields, multiFields);
  +                addFieldsToMap(doc, fields, fieldMap);
                   
                   Set keywords = handler.getKeywords();
                   addFieldsToMap(doc, keywords, multiKeywords);
  @@ -336,6 +341,7 @@
               
               o.setMultiKeywords(multiKeywords);
               o.setMultiFields(multiFields);
  +            o.setFields(fieldMap);
           }
           catch(Exception e)
           {
  @@ -343,7 +349,7 @@
           }
       }
       
  -    private void addFieldsToMap(Document doc, Set fieldNames, MultiMap fields)
  +    private void addFieldsToMap(Document doc, Set fieldNames, Map fields)
       {
           Iterator fieldIter = fieldNames.iterator();
           while(fieldIter.hasNext())
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message