Exemplo n.º 1
0
        static void Main(string[] args) {
            IIndex cardsIndex = Index.Create(new DirectoryInfo(@"C:\Net4\Crime Stats\Indexes\Cards"));
            IIndex formsIndex = Index.Create(new DirectoryInfo(@"C:\Net4\Crime Stats\Indexes\Forms"));
            IIndex monthlyFormsIndex = Index.Create(new DirectoryInfo(@"C:\Net4\Crime Stats\Indexes\MonthlyForms"));

            var cardsSearcher = cardsIndex.GetSearcher();
            var formsSearcher = formsIndex.GetSearcher();
            var monthlySearcher = monthlyFormsIndex.GetSearcher();

            QueryBuilder formBuilder = new QueryBuilder();
            formBuilder.AddStringQuery("+(Year:2005 Year:2006 Year:2007 Year:2008 Year:2009) +(NumericStateCode:28)", ClauseOccurrence.MustOccur, AnalyzerType.Standard, false);

            foreach (var formResult in formsSearcher.Search(formBuilder)) {
                
            }

            DateTime startTime = DateTime.Now;

            //Random random = new Random();
            //double requestNumber = ((random.NextDouble() + 0.0000000001) * 1000000000) % 9999999999;
            //double cookieNumber = ((random.NextDouble() + 0.0000001) * 10000000) % 99999999;
            //double randomNumber = ((random.NextDouble() + 0.0000000001) * 1000000000) % 2147483647;

            //GoogleAnalyticsPageTrackSubmitter submitter = new GoogleAnalyticsPageTrackSubmitter(GoogleAnalyticsRequestType.Page);
            //submitter.AccountString.Value = "UA-27532234-1";
            //submitter.ClientBrowserLanguageEncoding.Value = "UTF-8";
            //submitter.PageTitle.Value = "ILB";
            //submitter.HostName.Value = "clients.theatomgroup.com";
            //submitter.ClientBrowserJavaEnabled.Value = true;
            //submitter.RelativeUrl.Value = @"/fakePage/index.html";
            //submitter.CookieValues.Value = @"__utma=247248150.2078399374.1323295963.1323369219.1323373536.3;+__utmz=247248150.1323295963.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);";
            //submitter.ClientBrowserCultureCode.Value = "en-us";
            //submitter.TrackingCodeVersion.Value = "5.1.6";
            //submitter.RequestID.Value = (ulong)requestNumber;
            //submitter.AdsenseID.Value = (ulong)cookieNumber;
            //submitter.Post();

            return;

            Console.WriteLine();
            Console.WriteLine("Completed in {0} seconds", DateTime.Now.Subtract(startTime).TotalSeconds);
            Console.Write("Press any key to exit...");
            Console.ReadKey(true);

            AnalysisWriter.Instance.Dispose();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Merges the specified builders with this one.
        /// </summary>
        /// <param name="builders">The QueryBuilders to merge into this one.</param>
        public void Merge(QueryBuilder[] builders)
        {
            if (builders == null)
                throw new ArgumentNullException("builders", "builders cannot be null");
            int totalBuilders = builders.Length;
            System.Collections.Generic.List<Query> queries = new System.Collections.Generic.List<Query>(totalBuilders);
            for (int i = 0; i < totalBuilders; i++) {
                if (builders[i].totalClauses == 0)
                    continue;
                IncrementTotalClauses(builders[i].totalClauses);
                queries.Add(builders[i].luceneQuery);
            }

            if (queries.Count > 0)
                this.luceneQuery.Combine(queries.ToArray());
        }
Exemplo n.º 3
0
 /// <summary>
 /// Merges the specified builder with this one.
 /// </summary>
 /// <param name="builder">The QueryBuilders to merge into this one.</param>
 public void Merge(QueryBuilder builder)
 {
     if (builder == null)
         throw new ArgumentNullException("builder", "builder cannot be null");
     if (builder.TotalClauses == 0)
         return;
     IncrementTotalClauses(builder.totalClauses);
     this.luceneQuery = (BooleanQuery)this.luceneQuery.Combine(new Query[] { this.luceneQuery, builder.luceneQuery });
 }
Exemplo n.º 4
0
 /// <summary>
 /// Appends the clauses from the specified builders into this one.
 /// </summary>
 /// <param name="builders">The builders.</param>
 /// <param name="occurrence">The occurrence.</param>
 /// /// <remarks>
 /// Append is simply a way of adding another query to this boolean query
 /// </remarks>
 public void Append(QueryBuilder[] builders, ClauseOccurrence occurrence)
 {
     if (builders == null)
         throw new ArgumentNullException("builders", "builders cannot be null");
     int totalBuilders = builders.Length;
     for (int i = 0; i < totalBuilders; i++)
         Append(builders[i], occurrence);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Appends the clauses from the specified builders into this one.
 /// </summary>
 /// <param name="builders">The builders.</param>
 /// /// <remarks>
 /// Append is simply a way of adding another query to this boolean query
 /// </remarks>
 public void Append(QueryBuilder[] builders)
 {
     Append(builders, ClauseOccurrence.Default);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Appends the clauses from the specified builder into this one.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="occurrence">The occurrence.</param>
 /// /// <remarks>
 /// Append is simply a way of adding another query to this boolean query
 /// </remarks>
 public void Append(QueryBuilder builder, ClauseOccurrence occurrence)
 {
     if (builder == null)
         throw new ArgumentNullException("builder", "QueryBuilder cannot be null");
     if (builder.luceneQuery == null)
         throw new ArgumentException("QueryBuilder is not valid", "builder");
     if (builder.TotalClauses == 0)
         return;
     IncrementTotalClauses(builder.totalClauses);
     this.luceneQuery.Add(builder.luceneQuery, TypeConverter.ConvertToLuceneClauseOccurrence(occurrence));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Appends the clauses from the specified builder into this one.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <remarks>
 /// Append is simply a way of adding another query to this boolean query
 /// </remarks>
 public void Append(QueryBuilder builder)
 {
     Append(builder, ClauseOccurrence.Default);
 }