001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/search/tags/sakai_2-4-1/search-api/api/src/java/org/sakaiproject/search/api/SearchResult.java $
003: * $Id: SearchResult.java 20023 2006-12-29 19:02:06Z ian@caret.cam.ac.uk $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.search.api;
021:
022: import java.io.IOException;
023: import java.util.Map;
024:
025: /**
026: * @author ieb
027: */
028: public interface SearchResult {
029:
030: /**
031: * the result score
032: *
033: * @return
034: */
035: float getScore();
036:
037: /**
038: * The result ID (entity id)
039: *
040: * @return
041: */
042: String getId();
043:
044: /**
045: * All field names in the search record
046: *
047: * @return
048: */
049: String[] getFieldNames();
050:
051: /**
052: * All values in a search field
053: *
054: * @param string
055: * @return
056: */
057: String[] getValues(String string);
058:
059: /**
060: * Get a map of values in the result
061: *
062: * @return
063: */
064: Map getValueMap();
065:
066: /**
067: * An absolute URL to the resource (no host, protocol or port)
068: *
069: * @return
070: */
071: String getUrl();
072:
073: /**
074: * The title of the resource, usually including the type (eg Wiki Page,
075: * Resource)
076: *
077: * @return
078: */
079: String getTitle();
080:
081: /**
082: * get the index of the search entry over the whole change set
083: *
084: * @return
085: */
086: int getIndex();
087:
088: /**
089: * get the search result content for display
090: */
091: String getSearchResult();
092:
093: /**
094: * get the Sakai Entity Reference String
095: * @return
096: */
097: String getReference();
098:
099: /**
100: * gets the term frequencies for this Document
101: * @return
102: * @throws IOException
103: */
104: TermFrequency getTerms() throws IOException;
105:
106: /**
107: * get the tool name that this search cam from
108: * @return
109: */
110: String getTool();
111:
112: void toXMLString(StringBuffer sb);
113:
114: }
|