Solr search capability

First attempt at issue #9. Adds new indexing capability on create/update/delete, includes embedded Solr and test cases/data. Rebased from master to keep things in sync.
There's a way to avoid n+1 that is doing a query searching for all
questions in (:ids) and, after that, using session.load to get the
questions in the specified order(the hibernate would get the questions from
the first level cache once you already selected them before). (yeah, its
not pretty, but works)


2014-08-21 11:24 GMT-03:00 monitorjbl <notifications@github.com>:

> In src/main/java/org/mamute/controllers/SearchController.java:
>
> > +						"information.status",
> > +						"information.ip",
> > +						"information.tags.author",
> > +						"information.tags.usageCount"
> > +				).serialize();
> > +	}
> > +
> > +	private List<Question> doSearch(String query) {
> > +		String sanitized = HtmlSanitizer.sanitize(query);
> > +		List<Long> ids = index.findQuestionsByTitle(sanitized, 10);
> > +		List<Question> questions = new ArrayList<>();
> > +		for (Long id : ids) {
> > +			questions.add(dao.getById(id));
> > +		}
> > +		return questions;
> > +	}
>
> Quick implementation note: I'm going to do this the same way in the DAO to
> preserve the order of the suggestions from Solr. It's more round-trips to
> the DB, but I don't know how else you'd do this with a single query.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/caelum/mamute/pull/43/files#r16541603>.
>