Package org.apache.jetspeed.search

Examples of org.apache.jetspeed.search.BaseParsedObject


            SolrDocumentList docList = rsp.getResults();
            List<ParsedObject> resultList = new ArrayList<ParsedObject>();
           
            for (SolrDocument doc : docList)
            {
                ParsedObject result = new BaseParsedObject();
               
                addFieldsToParsedObject(doc, result);
               
                Object type = doc.getFirstValue(ParsedObject.FIELDNAME_TYPE);
                if(type != null)
                {
                    result.setType(type.toString());
                }
               
                Object key = doc.getFirstValue(ParsedObject.FIELDNAME_KEY);
                if(key != null)
                {
                    result.setKey(key.toString());
                }
               
                Object description = doc.getFirstValue(ParsedObject.FIELDNAME_DESCRIPTION);
                if(description != null)
                {
                    result.setDescription(description.toString());
                }
               
                Object title = doc.getFirstValue(ParsedObject.FIELDNAME_TITLE);
                if(title != null)
                {
                    result.setTitle(title.toString());
                }
               
                Object content = doc.getFirstValue(ParsedObject.FIELDNAME_CONTENT);
                if(content != null)
                {
                    result.setContent(content.toString());
                }
               
                Object language = doc.getFirstValue(ParsedObject.FIELDNAME_LANGUAGE);
                if (language != null)
                {
                    result.setLanguage(language.toString());
                }
               
                Object classname = doc.getFirstValue(ParsedObject.FIELDNAME_CLASSNAME);
                if (classname != null)
                {
                    result.setClassName(classname.toString());
                }
               
                Object url = doc.getFirstValue(ParsedObject.FIELDNAME_URL);
                if (url != null)
                {
                    result.setURL(new URL(url.toString()));
                }
               
                Collection<Object> keywords = doc.getFieldValues(ParsedObject.FIELDNAME_KEYWORDS);
                if(keywords != null)
                {
                    String[] keywordArray = new String[keywords.size()];
                    int index = 0;
                   
                    for (Object keyword : keywords)
                    {
                        keywordArray[index++] = keyword.toString();
                    }
                   
                    result.setKeywords(keywordArray);
                }
               
                resultList.add(result);
            }
           
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.search.BaseParsedObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.