Classes in assembly Smartsite.EnterpriseSearch.Search can be used to implement a search application in a .net environment. The assembly is available for .net 4.8 and .net 6.0.
Query classes are used to specify a search query. Use objects, methods and properties as usual for .net. Each class can produce .json corresponding to the query, which is used to build the .json for a complete query. The complete query is sent to Elastic Search in order to perform an actual search.
Classes for the query components of a complete query mimic as much as possible query components as used by Elastic Search.
For a search application there is no need to use query components to build-up a complete query; this is done by class SearchQuery, see below. Query component classes are a preparation for searches that require full control over the search approach.
|Abstract base class for parts of the search query.
|Boolean compound query. It contains a set of must-queries, a set of should-queries, and a set of must-not-queries.
|Query that uses the search words for a search in multiple fields of a document, for example to search "test" in fields doc_title and doc_body.
|Query to wrap a query, in order to apply the query to nested documents. The nested query has no 1:1 counterpart in Elastic Search. It is an Enterprise Search implementation to search documents in a mini hierarchy of documents, and to find the root document of the hierarchy.
|Query for a range of values in a field. The general range query is currently not supported. Instead the class implements the specialized date range query, applied to document field doc_created.
|Query that uses a term to filter, given a field of a document, for example to filter on a keyword given field doc_keywords.
|Query that uses multiple terms to filter, given a field of a document, for example to filter on keywords given field doc_keywords. The filter matches if one or more terms match.
Enumerations supporting the query classes:
|Enumeration of the above boolean query occurrence types: Must, Should and MustNot.
|Enumeration of the multi-match query types: BestFields for a regular search, Phrase to match an entire field, PhrasePrefix to match a prefix in the field, PhraseSuffix to match a suffix in the field. PhraseSuffix has no 1:1 counterpart in Elastic Search. It is an Enterprise Search implementation that uses a PhrasePrefix, applied to the reverse of words.
Aggregation specifications can be added to the search specification:
- in order to request aggregation counts, in addition to the search result itself,
- and optionally in order to request to filter the search result given aggregation values.
The search application uses aggregations to implement facets and facetted search.
|Abstract base class for search query aggregations.
|Aggregation resulting in one bucket per specified date range. This is applied to field doc_created by default.
|Aggregation resulting in one bucket per unique term, limited to the number of buckets.
|Deprecated class. Use SearchQueryTermsAggregation instead.
Support for the aggregation classes:
|Enumeration of aggregation types: Terms, Cardinality or DateRange. This enumeration will be revoked, differentiating between types by means of class types such as SearchQueryTermsAggregation and SearchQueryDateRangeAggregation.
|One date range for use by class SearchQueryDateRangeAggregation. Includes a from-date specification and/or to-date specification. Date specifications support date math as supported by Elastic Search.
In addition to requesting aggregations it is possible to add filter values to the aggregation, requesting to keep the search results that match the filter values.
|Abstract base class for a filter value.
|Filter value containing a from-date specification and/or containing a to-date specification. This is applied to field doc_created by default. Multiple date range filter values are possible, handled as an OR.
|Filter value containing a term, or more generally a string. Multiple term filter values are possible, handles as an OR.
A few classes allow to control the presentation of the search result.
|Specification of a field for result ordering, and whether this should be ascending or descending.
|Specifies how to highlight found text in search result fragments.
The Searcher class performs an actual search. In order to perform the search it requires a search query and it requires the list of Elastic Search indexes to search.
|Specification of one document field to search and, for example, which weight to apply.
|Enumeration of search field types: FullText, ValueOfField or ValuesWithinField. This has no counterpart in Elastic Search. It is an Enterprise Search implementation to express the intent how the field should be used to search, and this steers how parts of the .json search query are built.
|Builds and represents the complete search query. This includes the list of fields to search, aggregations, result ordering, result highlighting, paging and more.
|Accepts the search query and performs the actual search by sending the .json search specification to Elastic Search. Captures the search result and returns this result to the search application.
Search result classes
Result classes are used to return the search result to the search application. Class Searcher captures the .json search result as returned by Elastic Search, and converts this to result class instances representing the search result.
|Represents one hit in the search result. Contains the found document as an instance of class EsDocument. This class resides in assembly Smartsite.EnterpriseSearch.Base.
|Builds a snippet, preferably using a highlighted fragment, else using a field of the found document. The result snippet is set in in the above SearchResultEntry.
|This is one distinct aggregation value, with a count of the number of occurrences in the search result.
|This is a set of aggregation entries for one field / for one aggregation request. Multiple sets can be present in the search result.
|Search result as returned to the search application. It contains a list of search result entries, a list of search result aggregations and more, for example the current search result page.
Xml result classes
Class SearchResult can return xml for the search result. This provides access from for example PHP environments that are remote and/or that cannot access .net assemblies.
|Settings for the xml to return, for example whether to include the document associated with each search result hit.
Helper classes are not specifically search classes or result classes. Helper classes are included if used by the search or result classes, or if they could be useful for the search application.
|Abstract base class for url builder classes.
|Url builder that supports to read and modify a name-value collection that corresponds to the query arguments of the url.