F# Application example #3

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
1 participant
@ghost

ghost commented Apr 25, 2012

I don't know if that could be useful or not but here is Lucene.NET usage example on F#

    let LuceneWrite() = 
        let filename = AppDomain.CurrentDomain.BaseDirectory + "LuceneIndex"
        printfn "Lucene index: %s" filename
        use directory = FSDirectory.Open(new System.IO.DirectoryInfo(filename));
        let version = new Lucene.Net.Util.Version()
        let analyzer = new StandardAnalyzer(version)
        use writer = new IndexWriter(directory, analyzer, IndexWriter.MaxFieldLength.UNLIMITED)
        let indexReader = IndexReader.Open(directory, false)
        AddTextToIndex 0 "hello" writer
        writer.Optimize()
        writer.Commit()
        //Sercher example
        use searcher = new IndexSearcher(directory, false)
        let parser = new QueryParser(version, "postBody", analyzer)
        Search "hello" searcher parser indexReader

asfgit closed this Oct 3, 2013

@asfgit asfgit pushed a commit that referenced this pull request Feb 26, 2014

@paulirwin paulirwin Merge pull request #3 from hackmp/lucene_4_3_0
corrections for iterator
a7cc2bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment