Skip to content

Instantly share code, notes, and snippets.

View pkrakowiak's full-sized avatar

Paweł Krakowiak pkrakowiak

  • Miraculum Software
  • Krakow, Poland
  • 20:30 (UTC +02:00)
View GitHub Profile
using Lucene.Net.Analysis.Snowball;
using Lucene.Net.Util;
namespace FieldTripFinder.Lucene.Analyzers
{
public class EnglishSnowballAnalyzer : SnowballAnalyzer
{
public EnglishSnowballAnalyzer() : base(Version.LUCENE_30, "English")
{
@pkrakowiak
pkrakowiak / CanUseAndOperatorOnLuceneQuery.cs
Created February 28, 2013 12:45
AND operator doesn't seem to be working in RavenDB Client. Details: https://groups.google.com/forum/?fromgroups=#!topic/ravendb/vU61Qh6j0o4
using Raven.Abstractions.Data;
using Raven.Tests.Helpers;
using Xunit;
namespace LuceneAnd.RavenTests
{
public class CanUseAndOperatorOnLuceneQuery : RavenTestBase
{
private class Place
{
@pkrakowiak
pkrakowiak / places.html
Created February 14, 2013 16:10
Trying to get the Google Places API to work correctly (again). It used to return better results, but now if you type in two or more words in the search box you'll get no results. Works good if you just provide one word, though.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places&amp;sensor=false"></script>
</head>
<body>
<input type="text" id="search" style="width: 300px;" /><input type="button" id="searchBtn" value="Search"/><br/>
<div id="map" style="width: 300px; height: 300px;"></div>
<div id="results" style="width: 600px;height: 600px;background-color:gray;color:white;"></div>
@pkrakowiak
pkrakowiak / gist:4234174
Created December 7, 2012 15:57
Using RavenDB's Patching API to increment a number on a document
session.Advanced.DatabaseCommands.Patch("Searches/" + entity.Id, new [] // TODO: Don't use magic strings!
{
new PatchRequest
{
Type = PatchCommandType.Inc,
Name = "Visits",
Value = new RavenJValue(1)
}
});
@pkrakowiak
pkrakowiak / gist:4116598
Created November 20, 2012 07:37
Parent/child queries in ElasticSearch
curl -XPUT localhost:9200/authors/bare_author/1 -d'{
"name": "Multi G. Enre"
}'
curl -XPUT localhost:9200/authors/bare_author/2 -d'{
"name": "Alastair Reynolds"
}'
curl -XPOST localhost:9200/authors/book/_mapping -d '{
"book":{