Class WebSearchOrganicResult
-
- All Implemented Interfaces:
public class WebSearchOrganicResultRepresents an organic search results are the web pages that are returned by the search engine in response to a search query. This includes the title, URL, snippet and/or content, and metadata of the web page.
These results are typically ranked by relevance to the search query.
-
-
Constructor Summary
Constructors Constructor Description WebSearchOrganicResult(String title, URI url)Constructs a WebSearchOrganicResult object with the given title and URL. WebSearchOrganicResult(String title, URI url, String snippet, String content)Constructs a WebSearchOrganicResult object with the given title, URL, snippet and/or content. WebSearchOrganicResult(String title, URI url, String snippet, String content, Map<String, String> metadata)Constructs a WebSearchOrganicResult object with the given title, URL, snippet and/or content, and metadata.
-
Method Summary
Modifier and Type Method Description Stringtitle()Returns the title of the web page. URIurl()Returns the URL associated with the web page. Stringsnippet()Returns the snippet associated with the web page. Stringcontent()Returns the content scraped from the web page. Map<String, String>metadata()Returns the result metadata associated with the search result. booleanequals(Object o)inthashCode()StringtoString()TextSegmenttoTextSegment()Converts this WebSearchOrganicResult to a TextSegment. DocumenttoDocument()Converts this WebSearchOrganicResult to a Document. static WebSearchOrganicResultfrom(String title, URI url)Creates a WebSearchOrganicResult object from the given title and URL. static WebSearchOrganicResultfrom(String title, URI url, String snippet, String content)Creates a WebSearchOrganicResult object from the given title, URL, snippet and/or content. static WebSearchOrganicResultfrom(String title, URI url, String snippet, String content, Map<String, String> metadata)Creates a WebSearchOrganicResult object from the given title, URL, snippet and/or content, and result metadata. -
-
Constructor Detail
-
WebSearchOrganicResult
WebSearchOrganicResult(String title, URI url)
Constructs a WebSearchOrganicResult object with the given title and URL.- Parameters:
title- The title of the search result.url- The URL associated with the search result.
-
WebSearchOrganicResult
WebSearchOrganicResult(String title, URI url, String snippet, String content)
Constructs a WebSearchOrganicResult object with the given title, URL, snippet and/or content.- Parameters:
title- The title of the search result.url- The URL associated with the search result.snippet- The snippet of the search result, in plain text.content- The most query related content from the scraped url.
-
WebSearchOrganicResult
WebSearchOrganicResult(String title, URI url, String snippet, String content, Map<String, String> metadata)
Constructs a WebSearchOrganicResult object with the given title, URL, snippet and/or content, and metadata.- Parameters:
title- The title of the search result.url- The URL associated with the search result.snippet- The snippet of the search result, in plain text.content- The most query related content from the scraped url.metadata- The metadata associated with the search result.
-
-
Method Detail
-
url
URI url()
Returns the URL associated with the web page.
- Returns:
The URL associated with the web page.
-
snippet
String snippet()
Returns the snippet associated with the web page.
- Returns:
The snippet associated with the web page.
-
content
String content()
Returns the content scraped from the web page.
- Returns:
The content scraped from the web page.
-
metadata
Map<String, String> metadata()
Returns the result metadata associated with the search result.
- Returns:
The result metadata associated with the search result.
-
hashCode
int hashCode()
-
toTextSegment
TextSegment toTextSegment()
Converts this WebSearchOrganicResult to a TextSegment.
- Returns:
The TextSegment representation of this WebSearchOrganicResult.
-
toDocument
Document toDocument()
Converts this WebSearchOrganicResult to a Document.
- Returns:
The Document representation of this WebSearchOrganicResult.
-
from
static WebSearchOrganicResult from(String title, URI url)
Creates a WebSearchOrganicResult object from the given title and URL.
- Parameters:
title- The title of the search result.url- The URL associated with the search result.- Returns:
The created WebSearchOrganicResult object.
-
from
static WebSearchOrganicResult from(String title, URI url, String snippet, String content)
Creates a WebSearchOrganicResult object from the given title, URL, snippet and/or content.
- Parameters:
title- The title of the search result.url- The URL associated with the search result.snippet- The snippet of the search result, in plain text.content- The most query related content from the scraped url.- Returns:
The created WebSearchOrganicResult object.
-
from
static WebSearchOrganicResult from(String title, URI url, String snippet, String content, Map<String, String> metadata)
Creates a WebSearchOrganicResult object from the given title, URL, snippet and/or content, and result metadata.
- Parameters:
title- The title of the search result.url- The URL associated with the search result.snippet- The snippet of the search result, in plain text.content- The most query related content from the scraped url.metadata- The metadata associated with the search result.- Returns:
The created WebSearchOrganicResult object.
-
-
-
-