Click here to Skip to main content
15,886,258 members
Articles / Programming Languages / C#

Lucene.Net ultra fast search for MVC or WebForms site => made easy!

Rate me:
Please Sign up or sign in to vote.
4.92/5 (138 votes)
22 Aug 2013CPOL17 min read 655K   12.1K   331  
Step-by-step tutorial for any developer who wishes to get Lucene.Net search working with their web site or app really quickly!
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>
    </ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{410CE422-837F-4B31-A4DF-7198DE2B5CEA}</ProjectGuid>
    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>WebFormsLuceneSampleApp</RootNamespace>
    <AssemblyName>WebFormsLuceneSampleApp</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <UseIISExpress>false</UseIISExpress>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <UpgradeBackupLocation>
    </UpgradeBackupLocation>
    <OldToolsVersion>4.0</OldToolsVersion>
    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
    <RestorePackages>true</RestorePackages>
    <IISExpressSSLPort />
    <IISExpressAnonymousAuthentication />
    <IISExpressWindowsAuthentication />
    <IISExpressUseClassicPipelineMode />
    <TargetFrameworkProfile />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="ICSharpCode.SharpZipLib">
      <HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
    </Reference>
    <Reference Include="Lucene.Net">
      <HintPath>..\packages\Lucene.Net.3.0.3\lib\NET40\Lucene.Net.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Web.Extensions" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Web" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Configuration" />
    <Reference Include="System.Web.Services" />
    <Reference Include="System.EnterpriseServices" />
    <Reference Include="System.Web.DynamicData" />
    <Reference Include="System.Web.Entity" />
    <Reference Include="System.Web.ApplicationServices" />
    <Reference Include="System.Xml.Linq" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Content\style.local.css" />
    <Content Include="Content\kickstart\chosen.css" />
    <Content Include="Content\kickstart\fonts\base\icomoon-webfont.svg" />
    <Content Include="Content\kickstart\fonts\social\icomoonsocial-webfont.svg" />
    <Content Include="Content\kickstart\img\breadcrumbs-bg.gif" />
    <Content Include="Content\kickstart\img\chosen-sprite.png" />
    <Content Include="Content\kickstart\img\fancybox\blank.gif" />
    <Content Include="Content\kickstart\img\fancybox\fancybox-x.png" />
    <Content Include="Content\kickstart\img\fancybox\fancybox-y.png" />
    <Content Include="Content\kickstart\img\fancybox\fancybox.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_close.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_loading.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_nav_left.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_nav_right.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_shadow_e.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_shadow_n.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_shadow_ne.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_shadow_nw.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_shadow_s.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_shadow_se.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_shadow_sw.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_shadow_w.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_title_left.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_title_main.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_title_over.png" />
    <Content Include="Content\kickstart\img\fancybox\fancy_title_right.png" />
    <Content Include="Content\kickstart\img\fancybox\jquery.easing-1.3.pack.js" />
    <Content Include="Content\kickstart\img\fancybox\jquery.fancybox-1.3.4.js" />
    <Content Include="Content\kickstart\img\fancybox\jquery.fancybox-1.3.4.pack.js" />
    <Content Include="Content\kickstart\img\fancybox\jquery.mousewheel-3.0.4.pack.js" />
    <Content Include="Content\kickstart\img\grid.png" />
    <Content Include="Content\kickstart\img\icon-arrow-right.png" />
    <Content Include="Content\kickstart\img\icon-check.png" />
    <Content Include="Content\kickstart\img\rte\link.png" />
    <Content Include="Content\kickstart\img\rte\link_break.png" />
    <Content Include="Content\kickstart\img\rte\picture_empty.png" />
    <Content Include="Content\kickstart\img\rte\text_align_center.png" />
    <Content Include="Content\kickstart\img\rte\text_align_left.png" />
    <Content Include="Content\kickstart\img\rte\text_align_right.png" />
    <Content Include="Content\kickstart\img\rte\text_bold.png" />
    <Content Include="Content\kickstart\img\rte\text_italic.png" />
    <Content Include="Content\kickstart\img\rte\text_list_bullets.png" />
    <Content Include="Content\kickstart\img\rte\text_list_numbers.png" />
    <Content Include="Content\kickstart\img\rte\text_strikethrough.png" />
    <Content Include="Content\kickstart\img\rte\text_subscript.png" />
    <Content Include="Content\kickstart\img\rte\text_superscript.png" />
    <Content Include="Content\kickstart\jquery.fancybox-1.3.4.css" />
    <Content Include="Content\kickstart\kickstart-buttons.css" />
    <Content Include="Content\kickstart\kickstart-forms.css" />
    <Content Include="Content\kickstart\kickstart-grid.css" />
    <Content Include="Content\kickstart\kickstart-icons.css" />
    <Content Include="Content\kickstart\kickstart-menus.css" />
    <Content Include="Content\kickstart\kickstart.css" />
    <Content Include="Content\kickstart\prettify.css" />
    <Content Include="Content\kickstart\tiptip.css" />
    <Content Include="Content\style.css" />
    <Content Include="Content\style.lib.css" />
    <Content Include="Default.aspx" />
    <Content Include="Global.asax" />
    <Content Include="Scripts\jquery-1.7.2.min.js" />
    <Content Include="Scripts\kickstart.js" />
    <Content Include="Scripts\prettify.js" />
    <Content Include="Web.config" />
    <Content Include="Web.Debug.config">
      <DependentUpon>Web.config</DependentUpon>
    </Content>
    <Content Include="Web.Release.config">
      <DependentUpon>Web.config</DependentUpon>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Default.aspx.cs">
      <DependentUpon>Default.aspx</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="Default.aspx.designer.cs">
      <DependentUpon>Default.aspx</DependentUpon>
    </Compile>
    <Compile Include="Global.asax.cs">
      <DependentUpon>Global.asax</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Layout.Master.cs">
      <DependentUpon>Layout.Master</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="Layout.Master.designer.cs">
      <DependentUpon>Layout.Master</DependentUpon>
    </Compile>
    <Compile Include="ViewModels\DefaultViewModel.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Content\kickstart\fonts\base\icomoon-webfont.eot" />
    <None Include="Content\kickstart\fonts\base\icomoon-webfont.ttf" />
    <None Include="Content\kickstart\fonts\base\icomoon-webfont.woff" />
    <None Include="Content\kickstart\fonts\social\icomoonsocial-webfont.eot" />
    <None Include="Content\kickstart\fonts\social\icomoonsocial-webfont.ttf" />
    <None Include="Content\kickstart\fonts\social\icomoonsocial-webfont.woff" />
    <Content Include="packages.config" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Layout.Master" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\LuceneSearch.Data\LuceneSearch.Data.csproj">
      <Project>{9a9ea2f1-f0c7-4cbb-b822-58504fddde47}</Project>
      <Name>LuceneSearch.Data</Name>
    </ProjectReference>
    <ProjectReference Include="..\LuceneSearch.Library\LuceneSearch.Library.csproj">
      <Project>{DA2F9D29-5731-4CFE-BB9E-C0FD08DCEA3C}</Project>
      <Name>LuceneSearch.Library</Name>
    </ProjectReference>
  </ItemGroup>
  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseIIS>False</UseIIS>
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>56773</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl>
          </IISUrl>
          <NTLMAuthentication>False</NTLMAuthentication>
          <UseCustomServer>False</UseCustomServer>
          <CustomServerUrl>
          </CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
  <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Web Developer
United States United States
Coding is awesome!

Comments and Discussions