public IBooleanOperation GroupedNot(IEnumerable <string> fields, params IExamineValue[] query) { Enforcer.ArgumentNotNull(fields, "fields"); Enforcer.ArgumentNotNull(query, "query"); return(this.GroupedNotInternal(fields.ToArray(), query)); }
public IBooleanOperation Range(string fieldName, string start, string end) { Enforcer.ArgumentNotNull(fieldName, "fieldName"); Enforcer.ArgumentNotNull(start, "start"); Enforcer.ArgumentNotNull(end, "end"); return(this.Range(fieldName, start, end, true, true)); }
public IBooleanOperation GroupedOr(IEnumerable <string> fields, params IExamineValue[] fieldVals) { Enforcer.ArgumentNotNull(fields, "fields"); Enforcer.ArgumentNotNull(Query, "query"); return(this.GroupedOrInternal(fields.ToArray(), fieldVals, _occurance)); }
public IBooleanOperation Range(string fieldName, string start, string end, bool includeLower, bool includeUpper) { Enforcer.ArgumentNotNull(fieldName, "fieldName"); Enforcer.ArgumentNotNull(start, "start"); Enforcer.ArgumentNotNull(end, "end"); return(this.RangeInternal(fieldName, start, end, includeLower, includeUpper, _occurance)); }
public override ISearchResults Search(ISearchCriteria searchParams, int maxResults) { Enforcer.ArgumentNotNull(searchParams, "searchParams"); var luceneParams = searchParams as LuceneSearchCriteria; if (luceneParams == null) { throw new ArgumentException("Provided ISearchCriteria dos not match the allowed ISearchCriteria. Ensure you only use an ISearchCriteria created from the current SearcherProvider"); } //check if we are sorting on Score, if so we'll need to set a lucene config switch if (luceneParams.SortFields.Count == 0) { SetScoringBooleanQueryRewriteMethod(luceneParams.Query); } var searcher = GetSearcher(); if (searcher == null) { return(new EmptySearchResults()); } var pagesResults = new SearchResults(luceneParams.Query, luceneParams.SortFields, searcher, maxResults); return(pagesResults); }
public IBooleanOperation GroupedAnd(IEnumerable <string> fields, IExamineValue[] fieldVals) { Enforcer.ArgumentNotNull(fields, "fields"); Enforcer.ArgumentNotNull(query, "fieldVals"); return(this.GroupedAndInternal(fields.ToArray(), fieldVals.ToArray(), occurance)); }
public IBooleanOperation GroupedFlexible(IEnumerable <string> fields, IEnumerable <BooleanOperation> operations, params IExamineValue[] fieldVals) { Enforcer.ArgumentNotNull(fields, "fields"); Enforcer.ArgumentNotNull(query, "query"); Enforcer.ArgumentNotNull(operations, "operations"); return(this.GroupedFlexibleInternal(fields.ToArray(), operations.ToArray(), fieldVals, occurance)); }
internal LuceneSearchCriteria(string type, Analyzer analyzer, string[] fields, bool allowLeadingWildcards, BooleanOperation occurance) { Enforcer.ArgumentNotNull(fields, "fields"); SearchIndexType = type; Query = new BooleanQuery(); this.BooleanOperation = occurance; this.QueryParser = new MultiFieldQueryParser(_luceneVersion, fields, analyzer); this.QueryParser.SetAllowLeadingWildcard(allowLeadingWildcards); this._occurance = occurance.ToLuceneOccurance(); }
public IBooleanOperation GroupedAnd(IEnumerable <string> fields, params string[] query) { Enforcer.ArgumentNotNull(fields, "fields"); Enforcer.ArgumentNotNull(query, "query"); var fieldVals = new List <IExamineValue>(); foreach (var f in query) { fieldVals.Add(new ExamineValue(Examineness.Explicit, f)); } return(this.GroupedAnd(fields.ToArray(), fieldVals.ToArray())); }
internal LuceneSearchCriteria(string type, Analyzer analyzer, string[] fields, bool allowLeadingWildcards, BooleanOperation occurance) { //TODO: It would be nice to be able to pass in the existing field definitions here so // we'd know what fields have sorting enabled so we don't have to use the special sorting syntax for field types Enforcer.ArgumentNotNull(fields, "fields"); SearchIndexType = type; Query = new BooleanQuery(); this.BooleanOperation = occurance; this.QueryParser = new MultiFieldQueryParser(_luceneVersion, fields, analyzer); this.QueryParser.SetAllowLeadingWildcard(allowLeadingWildcards); this._occurance = occurance.ToLuceneOccurance(); }
public override ISearchResults Search(ISearchCriteria searchParams, int maxResults) { Enforcer.ArgumentNotNull(searchParams, "searchParams"); var luceneParams = searchParams as LuceneSearchCriteria; if (luceneParams == null) { throw new ArgumentException("Provided ISearchCriteria dos not match the allowed ISearchCriteria. Ensure you only use an ISearchCriteria created from the current SearcherProvider"); } var searcher = GetSearcher(); var pagesResults = new SearchResults(luceneParams.Query, luceneParams.SortFields, searcher, maxResults); return(pagesResults); }
public IBooleanOperation Field(string fieldName, IExamineValue fieldValue) { Enforcer.ArgumentNotNull(fieldName, "fieldName"); Enforcer.ArgumentNotNull(fieldValue, "fieldValue"); return(this.FieldInternal(fieldName, fieldValue, _occurance)); }
public IBooleanOperation NodeTypeAlias(IExamineValue nodeTypeAlias) { Enforcer.ArgumentNotNull(nodeTypeAlias, "nodeTypeAlias"); return(this.NodeTypeAliasInternal(nodeTypeAlias, _occurance)); }
/// <summary> /// Query on the NodeTypeAlias /// </summary> /// <param name="nodeTypeAlias">The node type alias.</param> /// <returns>A new <see cref="Examine.SearchCriteria.IBooleanOperation"/> with the clause appended</returns> public IBooleanOperation NodeTypeAlias(string nodeTypeAlias) { Enforcer.ArgumentNotNull(nodeTypeAlias, "nodeTypeAlias"); return(this.NodeTypeAlias(new ExamineValue(Examineness.Explicit, nodeTypeAlias))); }
public IBooleanOperation NodeName(IExamineValue nodeName) { Enforcer.ArgumentNotNull(nodeName, "nodeName"); return(this.NodeNameInternal(nodeName, _occurance)); }
/// <summary> /// Query on the NodeName /// </summary> /// <param name="nodeName">Name of the node.</param> /// <returns>A new <see cref="Examine.SearchCriteria.IBooleanOperation"/> with the clause appended</returns> public IBooleanOperation NodeName(string nodeName) { Enforcer.ArgumentNotNull(nodeName, "nodeName"); return(NodeName(new ExamineValue(Examineness.Explicit, nodeName))); }
/// <summary> /// Orders the results by the specified fields in a descending order /// </summary> /// <param name="fieldNames">The field names.</param> /// <returns>A new <see cref="Examine.SearchCriteria.IBooleanOperation"/> with the clause appended</returns> public IBooleanOperation OrderByDescending(params string[] fieldNames) { Enforcer.ArgumentNotNull(fieldNames, "fieldNames"); return(this.OrderByInternal(true, fieldNames)); }
public IBooleanOperation Field(string fieldName, string fieldValue) { Enforcer.ArgumentNotNull(fieldName, "fieldName"); Enforcer.ArgumentNotNull(fieldValue, "fieldValue"); return(this.FieldInternal(fieldName, new ExamineValue(Examineness.Explicit, fieldValue), _occurance)); }