Skip to content

Instantly share code, notes, and snippets.


Jorge Luis Betancourt jorgelbg

View GitHub Profile
View SearchAsYouType.html
<!doctype html>
<html lang="en">
<meta charset="utf-8" />
<title>search as you type</title>
<link rel="stylesheet" href="" />
<script src=""></script>
<script src=""></script>
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 gist:4b35f92c3be41e351045
Iterator<Inlink> iterator = inlinks.iterator();
while (iterator.hasNext()) {
String linkUrl =;
doc.add("inlinks", linkUrl);
View gist:803ea4d57d2eb89df031
Outlink[] outlinks = parse.getData().getOutlinks();
if (outlinks != null) {
for (Outlink outlink : outlinks) {
doc.add("outlinks", outlink.getToUrl());
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:2517ab87ace6f697d166
contentType = parse.getData().getMeta(Response.CONTENT_TYPE);
View gist:1f4e5fb446c6e25d24e8
String contentType = wContentType = datum.getMetaData().get(
new Text(Response.CONTENT_TYPE)).toString();
View gist:a9b767960ef9bc615294
mimeType = MIME.getMimeType(url.toString()).toString();
View gist:33fd12cc2d041a207bdb
mimeType = MIME.forName(MimeUtil.cleanMimeType(contentType)).toString();

Keybase proof

I hereby claim:

  • I am jorgelbg on github.
  • I am 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: