Open Visual Studio and go to File -> New -> Project.
Select appropriate project type - Console App, ASP.NET Web Application etc.
Install GroupDocs.Search for .NET from Nuget or official GroupDocs website following this guide.
Code your first application with GroupDocs.Search for .NET like this:
C#
stringindexFolder=@"c:\MyIndex\";stringdocumentsFolder=@"c:\MyDocuments\";// NOTE: Put here actual path for your documentsstringquery="Einstein";Indexindex=newIndex(indexFolder);// Creating index in the specified folderindex.Add(documentsFolder);// Indexing documents from the specified folderSearchResultresult=index.Search(query);// Searching in indexforeach(FoundDocumentdocumentinresult){Console.WriteLine(document.DocumentInfo.FilePath);}
Build and Run your project.
List of found documents will appear in the console.
Download examples from GitHub
The complete examples package of GroupDocs.Search is hosted on GitHub. You can either download the ZIP file from here or clone the repository of GitHub using your favourite GitHub client.
In case you download the ZIP file, extract the folders on your local disk. The extracted files and folders will look like following image:
In extracted files and folders, you can find the following solution file:
CSharp solution file
The project is created in Microsoft Visual Studio 2012. The Data folder contains all the sample document files used in the examples.
To run the examples, open the solution file in Visual Studio and build the project. To add missing references for GroupDocs.Search see Installation. All the functions are called from Program.cs. Un-comment the function you want to run and comment the rest.
Contribute
If you like to add or improve an example, we encourage you to contribute to the project. All examples in this repository are open source and can be freely used in your own applications.
To contribute, you can fork the repository, edit the code and create a pull request. We will review the changes and include it in the repository if found helpful.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.