Lucene.Net.Search.TestSloppyPhraseQuery.TestInfiniteFreq2 C# (CSharp) Method

TestInfiniteFreq2() private method

private TestInfiniteFreq2 ( ) : void
return void
        public virtual void TestInfiniteFreq2()
        {
            string document = "So much fun to be had in my head " + "No more sunshine " + "So much fun just lying in my bed " + "No more sunshine " + "I can't face the sunlight and the dirt outside " + "Wanna stay in 666 where this darkness don't lie " + "Drug drug druggy " + "Got a feeling sweet like honey " + "Drug drug druggy " + "Need sensation like my baby " + "Show me your scars you're so aware " + "I'm not barbaric I just care " + "Drug drug drug " + "I need a reflection to prove I exist " + "No more sunshine " + "I am a victim of designer blitz " + "No more sunshine " + "Dance like a robot when you're chained at the knee " + "The C.I.A say you're all they'll ever need " + "Drug drug druggy " + "Got a feeling sweet like honey " + "Drug drug druggy " + "Need sensation like my baby " + "Snort your lines you're so aware " + "I'm not barbaric I just care " + "Drug drug druggy " + "Got a feeling sweet like honey " + "Drug drug druggy " + "Need sensation like my baby";

            Directory dir = NewDirectory();

            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
            Document doc = new Document();
            doc.Add(NewField("lyrics", document, new FieldType(TextField.TYPE_NOT_STORED)));
            iw.AddDocument(doc);
            IndexReader ir = iw.Reader;
            iw.Dispose();

            IndexSearcher @is = NewSearcher(ir);

            PhraseQuery pq = new PhraseQuery();
            // "drug the drug"~5
            pq.Add(new Term("lyrics", "drug"), 1);
            pq.Add(new Term("lyrics", "drug"), 3);
            pq.Slop = 5;
            AssertSaneScoring(pq, @is);
            ir.Dispose();
            dir.Dispose();
        }
    }