Skip to content

Instantly share code, notes, and snippets.

View BartDM's full-sized avatar

Bart De Meyer BartDM

View GitHub Profile
using System;
using System.Collections.Specialized;
using System.Net;
using Greenshot.IniFile;
using GreenshotPlugin.Core;
namespace GreenshotDemoPlugin
{
public class DemoConnector: IDisposable
{
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";
using System;
using System.Collections.Generic;
using System.Linq;
namespace LuceneWrapper.TestApp
{
public class Program
{
private static List<Person> people;
namespace LuceneWrapper.TestApp
{
public class PersonSearcher:BaseSearcher
{
public PersonSearcher(string dataFolder) : base(dataFolder)
{
}
public SearchResult SearchPeople(string searchTerm, string field)
{
using System.Collections.Generic;
using System.Linq;
namespace LuceneWrapper.TestApp
{
public class PersonWriter : BaseWriter
{
public PersonWriter(string dataFolder)
: base(dataFolder)
{
using System.Collections.Generic;
using System.Linq;
namespace LuceneWrapper.TestApp
{
public class PersonDocument : ADocument
{
private string lastName;
private string firstName;
private IEnumerable<string> languages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LuceneWrapper.TestApp
{
public class Person
{
/// <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;
using System.Collections.Generic;
namespace LuceneWrapper
{
/// <summary>
/// Class to represent the Searh results
/// </summary>
public class SearchResult
{
public string SearchTerm { get; set; }
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>()
};