Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
coding

Jorge Luis Betancourt jorgelbg

:octocat:
coding
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am jorgelbg on github.
  • I am jorgelbg (https://keybase.io/jorgelbg) on keybase.
  • I have a public key whose fingerprint is AD39 A8A4 9ABF C3BF C75B 4549 4823 FD05 E8C3 8E51

To claim this, I am signing this object:

View gist:33fd12cc2d041a207bdb
mimeType = MIME.forName(MimeUtil.cleanMimeType(contentType)).toString();
View gist:a9b767960ef9bc615294
mimeType = MIME.getMimeType(url.toString()).toString();
View gist:1f4e5fb446c6e25d24e8
String contentType = wContentType = datum.getMetaData().get(
new Text(Response.CONTENT_TYPE)).toString();
View gist:2517ab87ace6f697d166
contentType = parse.getData().getMeta(Response.CONTENT_TYPE);
View gist:093ad39cb6c8f9130a65
for (int i = 0; i < this.indexingFilters.length; i++) {
doc = this.indexingFilters[i].filter(doc, parse, url, datum, inlinks);
// break the loop if an indexing filter discards the doc
if (doc == null) return null;
}
View gist:803ea4d57d2eb89df031
Outlink[] outlinks = parse.getData().getOutlinks();
if (outlinks != null) {
for (Outlink outlink : outlinks) {
doc.add("outlinks", outlink.getToUrl());
}
}
View gist:4b35f92c3be41e351045
Iterator<Inlink> iterator = inlinks.iterator();
while (iterator.hasNext()) {
String linkUrl = iterator.next().getFromUrl();
doc.add("inlinks", linkUrl);
}
@jorgelbg
jorgelbg / gist:26359441ffea773414fd
Created Aug 29, 2014
Solr SearchComponent to set limits to start and rows parameters on a SearchRequestHandler
View gist:26359441ffea773414fd
package cu.uci.solr;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.core.SolrCore;
import org.apache.solr.handler.component.ResponseBuilder;
import org.apache.solr.handler.component.SearchComponent;
import org.apache.solr.util.plugin.SolrCoreAware;
import org.apache.solr.common.util.NamedList;
View SearchAsYouType.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>search as you type</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<style>