This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected SearchResult Search<T>(string field, string searchQuery) where T : IDocument | |
{ | |
Log.DebugFormat("Searching for Type: {0} with query \"{1}\" for field \"{2}\"", typeof(T), searchQuery, field); | |
//Fetch the possible fields to search on | |
PropertyInfo[] properties = typeof(T).GetProperties(); | |
var fields = new List<string>(); | |
var fieldsToSearchOn = new List<string>(); | |
foreach (PropertyInfo property in properties) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
using log4net; | |
using Lucene.Net.Analysis.Standard; | |
using Lucene.Net.Index; | |
using Lucene.Net.Search; | |
using Lucene.Net.Util; | |
namespace LuceneWrapper | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using Lucene.Net.Store; | |
namespace LuceneWrapper | |
{ | |
/// <summary> | |
/// The abstract base class to be implemented by everything that uses the Lucene directory | |
/// </summary> | |
public abstract class BaseSearch | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Custom attribute to define the field that can be seached on | |
/// </summary> | |
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)] | |
public class SearchField : System.Attribute | |
{ | |
public string[] CombinedSearchFields; | |
public SearchField(params string[] values) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using Lucene.Net.Documents; | |
namespace LuceneWrapper | |
{ | |
/// <summary> | |
/// Abstract class as base for all Seach Documents | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Feature Id="ProductFeature" Title="DemoWebsite.Setup" Level="1"> | |
<ComponentGroupRef Id="MyWebWebComponents" /> | |
<ComponentGroupRef Id="DemoWebsiteIssConfiguration" /> | |
<Component Directory="INSTALLFOLDER" Id="InstallFolderCmp" Guid="{88D22DB9-656B-4423-AA6A-92875F5F74EC}"> | |
<File Id="WebConfigFile" KeyPath="yes" Source="$(var.publishDir)\Web.config" Vital="yes" /> | |
</Component> | |
</Feature> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Target Name="WIX"> | |
<!-- At last create an installer --> | |
<Exec | |
Command='"$(WixPath)candle" -ext WixIISExtension -ext WixUtilExtension -ext WixSqlExtension -dpublishDir=$(Publish) -dMyWebResourceDir=. @(WixCode, ' ')' | |
ContinueOnError="false" | |
WorkingDirectory="." /> | |
<Exec | |
Command='"$(WixPath)light" -ext WixIISExtension -ext WixUIExtension -ext WixUtilExtension -ext WixSqlExtension -out $(MsiOut) @(WixObject, ' ')' | |
ContinueOnError="false" | |
WorkingDirectory="." /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- The list of WIX input files --> | |
<ItemGroup> | |
<WixCode Include="Product.wxs" /> | |
<WixCode Include="$(WebSiteContentCode)" /> | |
<WixCode Include="DemoUI.wxs" /> | |
<WixCode Include="UIDialogs.wxs" /> | |
<WixCode Include="IISConfiguration.wxs" /> | |
<WixCode Include="Database.wxs" /> | |
</ItemGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" | |
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" | |
xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension"> | |
<Fragment> | |
<Binary Id="CreateTablesBin" SourceFile="Database/CreateTables.sql"></Binary> | |
<Binary Id="FillTablesBin" SourceFile="Database/FillTables.sql"></Binary> | |
<util:User Id="SQLUserSA" Name="[DB_USER]" Password="[DB_PASSWORD]"></util:User> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" | |
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" | |
xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension"> | |
<Fragment> | |
<Binary Id="CreateTablesBin" SourceFile="Database/CreateTables.sql"></Binary> | |
<Binary Id="FillTablesBin" SourceFile="Database/FillTables.sql"></Binary> | |
<util:User Id="SQLUserSA" Name="[DB_USER]" Password="[DB_PASSWORD]"></util:User> |