ravendb
Version:
RavenDB client for Node.js
152 lines • 6.45 kB
TypeScript
import { IQueryBase } from "./IQueryBase.js";
import { IFilterDocumentQueryBase } from "./IFilterDocumentQueryBase.js";
import { OrderingType } from "./OrderingType.js";
import { DynamicSpatialField } from "../Queries/Spatial/DynamicSpatialField.js";
import { ValueCallback } from "../../Types/Callbacks.js";
import { Explanations } from "../Queries/Explanation/Explanations.js";
import { ExplanationOptions } from "../Queries/Explanation/ExplanationOptions.js";
import { Highlightings } from "../Queries/Highlighting/Hightlightings.js";
import { HighlightingParameters } from "../Queries/Highlighting/HighlightingParameters.js";
import { IQueryIncludeBuilder } from "./Loaders/IQueryIncludeBuilder.js";
import { Field } from "../../Types/index.js";
import { IPagingDocumentQueryBase } from "./IPagingDocumentQueryBase.js";
export interface IDocumentQueryBase<T extends object, TSelf extends IDocumentQueryBase<T, TSelf>> extends IQueryBase<T, TSelf>, IFilterDocumentQueryBase<T, TSelf>, IPagingDocumentQueryBase<T, TSelf> {
/**
* Adds an ordering for a specific field to the query
*/
addOrder(fieldName: Field<T>, descending: boolean): TSelf;
/**
* Adds an ordering for a specific field to the query
*/
addOrder(fieldName: Field<T>, descending: boolean, ordering: OrderingType): TSelf;
/**
* Specifies a boost weight to the previous where clause.
* The higher the boost factor, the more relevant the term will be.
*
* boosting factor where 1.0 is default, less than 1.0 is lower weight, greater than 1.0 is higher weight
*
* http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Boosting%20a%20Term
*/
boost(boost: number): TSelf;
/**
* Apply distinct operation to this query
*/
distinct(): TSelf;
/**
* Explanations gives context how document was matched by query and provide information about how the score was calculated.
*/
includeExplanations(explanations: ValueCallback<Explanations>): TSelf;
/**
* Explanations gives context how document was matched by query and provide information about how the score was calculated.
*/
includeExplanations(options: ExplanationOptions, explanations: ValueCallback<Explanations>): TSelf;
/**
* Specifies a fuzziness factor to the single word term in the last where clause
* 0.0 to 1.0 where 1.0 means closer match
*
* https://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Fuzzy%20Searches
*/
fuzzy(fuzzy: number): TSelf;
highlight(parameters: HighlightingParameters, hightlightingsCallback: ValueCallback<Highlightings>): TSelf;
/**
* Includes the specified path in the query, loading the document specified in that path
*/
include(path: string): TSelf;
include(includes: (includeBuilder: IQueryIncludeBuilder) => void): TSelf;
/**
* Partition the query so we can intersect different parts of the query
* across different index entries.
*/
intersect(): TSelf;
/**
* Order the results by the specified fields
* The field is the name of the field to sort, defaulting to sorting by ascending.
*/
orderBy(field: string): TSelf;
/**
* Order the results by the specified fields
* The field is the name of the field to sort, defaulting to sorting by ascending.
*/
orderBy(field: string, ordering: OrderingType): TSelf;
/**
* Order the results by the specified fields
* The field is the name of the field to sort using sorterName
*/
orderBy(field: string, options: {
sorterName: string;
}): TSelf;
/**
* Order the results by the specified fields
* The field is the name of the field to sort, defaulting to sorting by descending.
*/
orderByDescending(field: string): TSelf;
/**
* Order the results by the specified fields
* The field is the name of the field to sort, defaulting to sorting by descending.
*/
orderByDescending(field: string, ordering: OrderingType): TSelf;
/**
* Order the results by the specified fields
* The field is the name of the field to sort using sorterName
*/
orderByDescending(field: string, options: {
sorterName: string;
}): TSelf;
/**
* Adds an ordering by score for a specific field to the query
*/
orderByScore(): TSelf;
/**
* Adds an ordering by score for a specific field to the query
*/
orderByScoreDescending(): TSelf;
/**
* Specifies a proximity distance for the phrase in the last search clause
* https://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Proximity%20Searches
*/
proximity(proximity: number): TSelf;
/**
* Order the search results randomly
*/
randomOrdering(): TSelf;
/**
* Order the search results randomly using the specified seed
* this is useful if you want to have repeatable random queries
*/
randomOrdering(seed: string): TSelf;
/**
* Sorts the query results by distance.
*/
orderByDistance(field: DynamicSpatialField, latitude: number, longitude: number): TSelf;
orderByDistance(field: DynamicSpatialField, shapeWkt: string): TSelf;
/**
* Sorts the query results by distance.
*/
orderByDistance(fieldName: Field<T>, latitude: number, longitude: number): TSelf;
/**
* Sorts the query results by distance.
*/
orderByDistance(fieldName: Field<T>, latitude: number, longitude: number, roundFactor: number): TSelf;
/**
* Sorts the query results by distance.
*/
orderByDistance(fieldName: Field<T>, shapeWkt: string): TSelf;
/**
* Sorts the query results by distance.
*/
orderByDistanceDescending(field: DynamicSpatialField, latitude: number, longitude: number): TSelf;
orderByDistanceDescending(field: DynamicSpatialField, shapeWkt: string): TSelf;
/**
* Sorts the query results by distance.
*/
orderByDistanceDescending(fieldName: Field<T>, latitude: number, longitude: number): TSelf;
/**
* Sorts the query results by distance.
*/
orderByDistanceDescending(fieldName: Field<T>, latitude: number, longitude: number, roundFactor: number): TSelf;
/**
* Sorts the query results by distance.
*/
orderByDistanceDescending(fieldName: Field<T>, shapeWkt: string): TSelf;
}
//# sourceMappingURL=IDocumentQueryBase.d.ts.map