/// <summary> /// Search the current field for an exact match to the <paramref name="value"/> token. /// </summary> /// <param name="value">The token to search for.</param> /// <returns>A constructed search <see cref="Term"/>.</returns> public Term Search(Token value) { this.term = new UnaryTerm(this, field, value); return this.term; }
/// <summary> /// Search the current field for a set of <paramref name="words"/> that /// are within a certain distance (<paramref name="proximity"/>) of each other. /// </summary> /// <param name="field">The field to search.</param> /// <param name="proximity">The maximum distance the words can be from each other.</param> /// <param name="words">The set of words to find within a certain distance of each other.</param> /// <returns>A constructed search <see cref="Term"/>.</returns> public ProximityTerm Proximity(string field, int proximity, params string[] words) { var term = new ProximityTerm(this, field, proximity, words); this.term = term; return term; }
/// <summary> /// Search the current field for values between <paramref name="from"/> and <paramref name="to"/>. /// </summary> /// <param name="from">The lower bound of values to search for.</param> /// <param name="to">The upper bound of values to search for.</param> /// <param name="inclusive">The option to include the bounds in the range or not.</param> /// <returns>A constructed search <see cref="Term"/>.</returns> public Term Between(Token from, Token to, bool inclusive = true) { this.term = new RangeTerm(this, field, from, to, inclusive); return this.term; }
/// <summary> /// Search the current field for the <paramref name="value"/> token, /// and group that query with another provided by <paramref name="groupSetup"/>. /// </summary> /// <param name="value">The token to search values for.</param> /// <param name="groupSetup"> /// A <see cref="Func{T1,T2}"/> that accepts a <see cref="Term"/> for fluent configuration, /// and returns that configured <see cref="Term"/>. /// </param> /// <returns>A constructed search <see cref="Term"/>.</returns> /// <remarks> /// Configure the phase with a lambda similar to: /// <code>new RiakFluentSearch("bucket", "key").Group("foo", t => t.Or("bar"));</code> /// The above filter will return the following grouped query string: /// <code>key:(key:foo OR key:bar)</code>. /// </remarks> public Term Group(Token value, Func<Term, Term> groupSetup) { var groupedTerm = groupSetup(new UnaryTerm(this, field, value)); grouped = true; this.term = new GroupTerm(this, field, groupedTerm); return this.term; }
/// <summary> /// Search the current field for an exact match to the <paramref name="value"/> token. /// </summary> /// <param name="value">The token to search for.</param> /// <returns>A constructed search <see cref="Term"/>.</returns> public Term Search(Token value) { this.term = new UnaryTerm(this, field, value); return(this.term); }
/// <summary> /// Search the current field for values between <paramref name="from"/> and <paramref name="to"/>. /// </summary> /// <param name="from">The lower bound of values to search for.</param> /// <param name="to">The upper bound of values to search for.</param> /// <param name="inclusive">The option to include the bounds in the range or not.</param> /// <returns>A constructed search <see cref="Term"/>.</returns> public Term Between(Token from, Token to, bool inclusive = true) { this.term = new RangeTerm(this, field, from, to, inclusive); return(this.term); }