lumis.search
Class SearchHit

Package class diagram package SearchHit
java.lang.Object
  extended by lumis.search.SearchHit
Direct Known Subclasses:
LuceneSearchHit

@StableMinor(version="5.5",
             sinceVersion="4.0")
public abstract class SearchHit
extends Object

An item of a SearchResults object. It represents an indexed information that match a query that was executed.

A SearchHit object returns some of the predefined fields (Title, Subtitle, URL) of the original indexed information, and the following additional fields:

Since:
4.0.4

Field Summary
protected  SearchAttributes attributes
           
protected  float rank
           
protected  String snippet
           
protected  String subtitle
           
protected  String title
           
protected  String url
           
 
Constructor Summary
SearchHit()
          Constructs an instance with null URL, title and subtitle predefined fields.
SearchHit(String url, String title, String subtitle)
          Constructs an instance with the given URL, title and subtitle predefined fields.
 
Method Summary
 SearchAttributes getAttributes()
          Returns the hit's attributes.
 String getParentId()
          Returns the identifier of the parent of this hit.
 float getRank()
          Returns the rank value.
 SearchContent getSearchContent()
          Returns a SearchContent object related to the hit, containing all fields.
 String getSnippet()
          Returns the snippet value.
 String getSubtitle()
          Returns the subtitle field value.
 String getTitle()
          Returns the title field value.
 String getUrl()
          Returns the URL field value.
 void setParentId(String parentId)
          Sets the parent identifier of this hit.
 void setRank(float rank)
          Sets the rank value.
 void setSnippet(String snippet)
          Sets the the snippet value.
 void setSubtitle(String subtitle)
          Sets the subtitle field value.
 void setTitle(String title)
          Sets the title field value.
 void setUrl(String url)
          Sets the URL field value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

protected String url

title

protected String title

subtitle

protected String subtitle

snippet

protected String snippet

rank

protected float rank

attributes

protected SearchAttributes attributes
Constructor Detail

SearchHit

public SearchHit()
Constructs an instance with null URL, title and subtitle predefined fields.

Since:
4.0.4
See Also:
SearchContentField.FIELDNAME_URL, SearchContentField.FIELDNAME_TITLE, SearchContentField.FIELDNAME_SUBTITLE

SearchHit

public SearchHit(String url,
                 String title,
                 String subtitle)
Constructs an instance with the given URL, title and subtitle predefined fields.

Parameters:
url - URL field value
title - title field
subtitle - subtitle field
Since:
4.0.4
See Also:
SearchContentField.FIELDNAME_URL, SearchContentField.FIELDNAME_TITLE, SearchContentField.FIELDNAME_SUBTITLE
Method Detail

getUrl

public String getUrl()
Returns the URL field value.

Returns:
URL field value
Since:
4.0.4
See Also:
SearchContentField.FIELDNAME_URL

setUrl

public void setUrl(String url)
Sets the URL field value.

Parameters:
url - URL field value
Since:
4.0.4
See Also:
SearchContentField.FIELDNAME_URL

getTitle

public String getTitle()
Returns the title field value.

Returns:
title field value
Since:
4.0.4
See Also:
SearchContentField.FIELDNAME_TITLE

setTitle

public void setTitle(String title)
Sets the title field value.

Parameters:
title - title field value
Since:
4.0.4
See Also:
SearchContentField.FIELDNAME_TITLE

getSubtitle

public String getSubtitle()
Returns the subtitle field value.

Returns:
subtitle field value
Since:
4.0.4
See Also:
SearchContentField.FIELDNAME_SUBTITLE

setSubtitle

public void setSubtitle(String subtitle)
Sets the subtitle field value.

Parameters:
subtitle - subtitle field value
Since:
4.0.4
See Also:
SearchContentField.FIELDNAME_SUBTITLE

getRank

public float getRank()
Returns the rank value.

Returns:
the rank value
Since:
4.0.4

setRank

public void setRank(float rank)
Sets the rank value.

Parameters:
rank - rank value
Since:
4.0.4

getSnippet

public String getSnippet()
Returns the snippet value.

Returns:
the snippet value
Since:
4.0.4

setSnippet

public void setSnippet(String snippet)
Sets the the snippet value.

Parameters:
snippet - snippet value
Since:
4.0.4

getParentId

public String getParentId()
Returns the identifier of the parent of this hit. When a SearchContent is indexed, the indexer may divide it into multiple entries. In this case a primary one should be set as the parent of the others.

Returns:
the identifier of the parent search content, or null if this is a primary hit.
Since:
4.2.2

setParentId

public void setParentId(String parentId)
Sets the parent identifier of this hit.

Parameters:
parentId - the parent identifier to set.
Since:
4.2.2
See Also:
getParentId()

getAttributes

public SearchAttributes getAttributes()
Returns the hit's attributes.

Attributes contain additional information returned by the search engine in a query execution.

Returns:
hit's attributes
Since:
4.0.4

getSearchContent

public SearchContent getSearchContent()
                               throws UnsupportedOperationException
Returns a SearchContent object related to the hit, containing all fields.

Implementations that do not support this opperation will throw an UnsupportedOperationException.

Returns:
SearchContent object related to the hit.
Throws:
UnsupportedOperationException
Since:
4.0.4


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.