Lines Matching defs:query

741  * a document and a query.
1352 * incoming query to the index, this query token set and index
1358 * case of a simple query token set.
1406 * Creates a token set from a query clause.
1410 * @param {string} clause.term - The query clause term.
1834 * An index contains the built index of all documents and provides a query interface
1858 * A result contains details of a document matching a search query.
1861 * @property {number} score - A number between 0 and 1 representing how similar this document is to the query.
1867 * query language which itself is parsed into an instance of lunr.Query.
1869 * For programmatically building queries it is advised to directly use lunr.Query, the query language
1879 * impact on query performance, especially with wildcards at the beginning of a term.
1882 * hello in the title field will match this query. Using a field not present in the index will lead
1888 * Avoid large values for edit distance to improve query performance.
1901 * @example <caption>Simple single term query</caption>
1903 * @example <caption>Multiple term query</caption>
1916 * Performs a search against the index using lunr query syntax.
1922 * For more programmatic querying use lunr.Index#query.
1924 * @param {lunr.Index~QueryString} queryString - A string containing a lunr query.
1925 * @throws {lunr.QueryParseError} If the passed query string cannot be parsed.
1929 return this.query(function (query) {
1930 var parser = new lunr.QueryParser(queryString, query)
1936 * A query builder callback provides a query object to be used to express
1937 * the query to perform on the index.
1940 * @param {lunr.Query} query - The query object to build up.
1945 * Performs a query against the index using the yielded lunr.Query object.
1948 * over lunr.Index#search so as to avoid the additional query parsing overhead.
1950 * A query object is yielded to the supplied function which should be used to
1951 * express the query to be run against the index.
1954 * asynchronous operation, the callback is just yielded a query object to be
1957 * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query.
1960 lunr.Index.prototype.query = function (fn) {
1961 // for each query clause
1968 var query = new lunr.Query(this.fields),
1976 * To support field level boosts a query vector is created per
1984 fn.call(query, query)
1986 for (var i = 0; i < query.clauses.length; i++) {
1993 * for a single query term.
1995 var clause = query.clauses[i],
2011 * Each term returned from the pipeline needs to use the same query
2044 * building the query vector.
2052 * For each field that this query term is scoped by (by default
2091 * Prohibited matches should not be part of the query vector used for
2099 * The query field vector is populated using the termIndex found for
2119 * of lunr.MatchData ready to be returned in the query
2179 * If the query is negated (contains only prohibited terms)
2181 * index. This is only done when we know that the query is
2188 if (query.isNegated()) {
2200 * Currently we have document fields that match the query, but we
2204 * Scores are calculated by field, using the query vectors created
2791 * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method
2792 * so the query object is pre-initialized with the right index fields.
2795 * @property {lunr.Query~Clause[]} clauses - An array of query clauses.
2804 * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause.
2819 * @example <caption>query term with trailing wildcard</caption>
2820 * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING })
2821 * @example <caption>query term with leading and trailing wildcard</caption>
2822 * query.term('foo', {
2840 * @example <caption>query term with required presence</caption>
2841 * query.term('foo', { presence: lunr.Query.presence.REQUIRED })
2876 * Adds a {@link lunr.Query~Clause} to this query.
2881 * @param {lunr.Query~Clause} clause - The clause to add to this query.
2920 * A negated query is one in which every clause has a presence of
2937 * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause}
2938 * to the list of clauses that make up this query.
2946 * @param {object|object[]} term - The term(s) to add to the query.
2947 * @param {object} [options] - Any additional properties to add to the query clause.
2951 * @example <caption>adding a single term to a query</caption>
2952 * query.term("foo")
2953 * @example <caption>adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard</caption>
2954 * query.term("foo", {
2960 * query.term(lunr.tokenizer("foo bar"))
3192 lunr.QueryParser = function (str, query) {
3194 this.query = query
3209 return this.query
3224 this.query.clause(completedClause)
3297 if (parser.query.allFields.indexOf(lexeme.str) == -1) {
3298 var possibleFields = parser.query.allFields.map(function (f) { return "'" + f + "'" }).join(', '),