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; | |
using System.Collections.Specialized; | |
using System.Net; | |
using Greenshot.IniFile; | |
using GreenshotPlugin.Core; | |
namespace GreenshotDemoPlugin | |
{ | |
public class DemoConnector: IDisposable | |
{ |
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 Greenshot.IniFile; | |
using GreenshotPlugin.Core; | |
namespace GreenshotDemoPlugin | |
{ | |
[IniSection("Demo", Description = "Greenshot Demo Plugin configuration")] | |
public class DemoConfiguration:IniSection | |
{ | |
private const string DEFAULT_URL = "https://THE_URL_TO_YOUR_APPLICATION"; |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace LuceneWrapper.TestApp | |
{ | |
public class Program | |
{ | |
private static List<Person> people; |
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
namespace LuceneWrapper.TestApp | |
{ | |
public class PersonSearcher:BaseSearcher | |
{ | |
public PersonSearcher(string dataFolder) : base(dataFolder) | |
{ | |
} | |
public SearchResult SearchPeople(string searchTerm, string field) | |
{ |
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; | |
namespace LuceneWrapper.TestApp | |
{ | |
public class PersonWriter : BaseWriter | |
{ | |
public PersonWriter(string dataFolder) | |
: base(dataFolder) | |
{ |
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; | |
namespace LuceneWrapper.TestApp | |
{ | |
public class PersonDocument : ADocument | |
{ | |
private string lastName; | |
private string firstName; | |
private IEnumerable<string> languages; |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace LuceneWrapper.TestApp | |
{ | |
public class Person | |
{ |
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> | |
/// Parse the givven query string to a Lucene Query object | |
/// </summary> | |
/// <param name="searchQuery">The query string</param> | |
/// <param name="parser">The Lucense QueryParser</param> | |
/// <returns>A Lucene Query object</returns> | |
private Query ParseQuery(string searchQuery, QueryParser parser) | |
{ | |
parser.AllowLeadingWildcard = true; | |
Query q; |
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; | |
namespace LuceneWrapper | |
{ | |
/// <summary> | |
/// Class to represent the Searh results | |
/// </summary> | |
public class SearchResult | |
{ | |
public string SearchTerm { get; set; } |
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 (var searcher = new IndexSearcher(LuceneDirectory)) | |
{ | |
Log.Debug("Starting new IndexSearcher"); | |
var analyzer = new StandardAnalyzer(Version.LUCENE_30); | |
var searchResults = new SearchResult | |
{ | |
SearchTerm = searchQuery, | |
SearchResultItems = new List<SearchResultItem>() | |
}; |