Method HighlightFields
HighlightFields(String[], Query, IndexSearcher, TopDocs)
Highlights the top passages from multiple fields.
Conceptually, this behaves as a more efficient form of:
IDictionary<string, string[]> m = new Dictionary<string, string[]>();
foreach (string field in fields)
{
m[field] = Highlight(field, query, searcher, topDocs);
}
return m;
Declaration
public virtual IDictionary<string, string[]> HighlightFields(string[] fields, Query query, IndexSearcher searcher, TopDocs topDocs)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | fields | field names to highlight. Must have a stored string value and also be indexed with offsets. |
Query | query | query to highlight. |
IndexSearcher | searcher | searcher that was previously used to execute the query. |
TopDocs | topDocs | TopDocs containing the summary result documents to highlight. |
Returns
Type | Description |
---|---|
IDictionary<System.String, System.String[]> |
|
HighlightFields(String[], Query, IndexSearcher, TopDocs, Int32[])
Highlights the top-N passages from multiple fields.
Conceptually, this behaves as a more efficient form of:
IDictionary<string, string[]> m = new Dictionary<string, string[]>();
foreach (string field in fields)
{
m[field] = Highlight(field, query, searcher, topDocs, maxPassages);
}
return m;
Declaration
public virtual IDictionary<string, string[]> HighlightFields(string[] fields, Query query, IndexSearcher searcher, TopDocs topDocs, int[] maxPassages)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | fields | field names to highlight. Must have a stored string value and also be indexed with offsets. |
Query | query | query to highlight. |
IndexSearcher | searcher | searcher that was previously used to execute the query. |
TopDocs | topDocs | TopDocs containing the summary result documents to highlight. |
System.Int32[] | maxPassages | The maximum number of top-N ranked passages per-field used to form the highlighted snippets. |
Returns
Type | Description |
---|---|
IDictionary<System.String, System.String[]> |
|
HighlightFields(String[], Query, IndexSearcher, Int32[], Int32[])
Highlights the top-N passages from multiple fields, for the provided int[] docids.
Declaration
public virtual IDictionary<string, string[]> HighlightFields(string[] fieldsIn, Query query, IndexSearcher searcher, int[] docidsIn, int[] maxPassagesIn)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | fieldsIn | field names to highlight. Must have a stored string value and also be indexed with offsets. |
Query | query | query to highlight. |
IndexSearcher | searcher | searcher that was previously used to execute the query. |
System.Int32[] | docidsIn | containing the document IDs to highlight. |
System.Int32[] | maxPassagesIn | The maximum number of top-N ranked passages per-field used to form the highlighted snippets. |
Returns
Type | Description |
---|---|
IDictionary<System.String, System.String[]> |
|