Click here to Skip to main content
11,924,825 members (44,885 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


32 bookmarked
Posted in simple example

, 19 Oct 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
How to use api from c# in enviroment


Lucene.Net is a source code, class-per-class, API-per-API and algorithmatic port of the Java Lucene search engine to the C# and .NET platform utilizing Microsoft .NET Framework. And this is a very simple example to show how you can call Lucene API. This example creates lucene index and makes a search on it. 


It would be nice if you already used lucene before but there is no need to dig into that java world. this example stands for that.

Using the code

When you start using lucene you need to check is the Index exist or not this function will help you to cover that area. 

private void IsIndexExists(out bool created, string sIndexPath)
    created = false;
    if (!IndexReader.IndexExists(sIndexPath))
        IndexWriter writer = new IndexWriter(sIndexPath,
            new StandardAnalyzer(), true);
        created = true;

this is not a full of code example. this is the simplest way to use pure API from that is why you should download the code and check it out.

Points of Interest

I had a problem with godaddy shared hosting when I tried to use there. btw I have deluxe windows hosting. And changed somelines from svn(Revision 706104) code and decided to publish it here. The dll which comes from this example's zip file is tested here.


20/10/2008   for the turkish version of this article blog.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior)
Turkey Turkey

You may also be interested in...

Comments and Discussions

QuestionScriptresoursehandler error Pin
lolipopkitty9-May-15 23:45
memberlolipopkitty9-May-15 23:45 
General[My vote of 1] My Vote of 1 Pin
Alireza_13625-Dec-13 18:06
memberAlireza_13625-Dec-13 18:06 
GeneralMy vote of 1 Pin
Farshad khadempour10-Jan-13 7:00
memberFarshad khadempour10-Jan-13 7:00 
GeneralMy vote of 1 Pin
Jeffrey Schaefer9-Aug-12 8:13
memberJeffrey Schaefer9-Aug-12 8:13 
GeneralMy vote of 2 Pin
silvia.stanila17-Jul-12 20:44
membersilvia.stanila17-Jul-12 20:44 
GeneralMy vote of 1 Pin
Anoop19879-Aug-11 6:21
memberAnoop19879-Aug-11 6:21 
Questionpassword ? Pin
hos cakal20-Jul-11 2:37
memberhos cakal20-Jul-11 2:37 
i cant open your project can you tall waht the pass is please
AnswerRe: password ? Pin
mascix20-Jul-11 5:28
membermascix20-Jul-11 5:28 
Generaldeneme.pfx Pin
Yanivush30-May-11 23:30
memberYanivush30-May-11 23:30 
GeneralAnother example of using Lucene.NET in ASP.NET Pin
ctrager29-Mar-09 1:46
memberctrager29-Mar-09 1:46 
GeneralNothing new Pin
Neetflash23-Oct-08 4:19
memberNeetflash23-Oct-08 4:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.151125.3 | Last Updated 19 Oct 2008
Article Copyright 2008 by ozkan.pakdil
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid