Commits on Feb 9, 2012
  1. Fix object_ids call to be less intense

    Previously, if you had set highlights, then object_ids() would call
    raw() and raw() would build a query that included a request for highlighted
    stuff and then you'd get a ton of JSON back when all you wanted were
    This code is specific to SUMO and uses code in elasticutils that is
    also specific to SUMO. Given that, I'm abusing the freedom to do a
    hacky fix where we gimp _build_highlight, call raw(), then ungimp it.
    This makes sure no highlight stuff shows up in the query and thus
    we don't get highlighted stuff in the returned JSON (and ES doesn't
    do all that highlighting work).
    willkg committed Feb 9, 2012
Commits on Dec 8, 2011
  1. Add a docstring.

    committed Dec 8, 2011
Commits on Dec 7, 2011
  1. Rename SphinxTolerantElastic to Sphilastic, because I need a shot of …

    …fun right now.
    (And the old name was confusing us, so at least we're not doing any worse.)
    committed Dec 7, 2011
  2. Nop out `group_by()` in SphinxTolerantElastic.

    ES doesn't support a straightforward group_by analogue. So, in ES, we're mashing subdocuments into the superdocument, making group_by unnecessary.
    committed Dec 7, 2011
  3. Implement object_ids() in SphinxTolerantElastic, and make sure @rank

    …translates to something ES understands.
    committed Dec 6, 2011
Commits on Dec 6, 2011
Commits on Dec 4, 2011
Commits on Dec 2, 2011
Commits on Nov 9, 2011
  1. Split ExcerptError into two separate exceptions

    This makes it possible to differentiate between the two for statsd
    willkg committed Nov 9, 2011
  2. Wrap excerpt in try/except

    excerpt can kick up socket.error and socket.timeout.  So we wrap it and
    throw ExcerptErrors if things go awry.
    willkg committed Nov 9, 2011
Commits on Nov 3, 2011
  1. Fix query() docs.

    committed Nov 3, 2011
Commits on Oct 27, 2011
  1. Fix excerpt to work with object results

    If the programmer wants object results, he/she doesn't call .values()
    or .values_dict() and thus _fields is not set.  We shouldn't throw
    an exception in that case.
    willkg committed Oct 27, 2011
  2. Undo a bit of 88d142d

    BuildExcerpts returns a list of content--not a list of tuples.  This
    fixes it back to what I had pre-88d142d.
    willkg committed Oct 27, 2011
  3. Fix minor issues

    * tweaks some documentation
    * removes some fluff from a test
    willkg committed Oct 27, 2011
Commits on Oct 26, 2011
  1. Make __getitem__ slice SearchResults

    This is sort of an implementation detail, but after an S has queried
    Sphinx, slices on S should apply to the search results without
    causing additional queries to Sphinx.
    willkg committed Oct 26, 2011
  2. Implement object_ids() on S

    object_ids returns the object id for Sphinx matches.  If there's a
    SphinxMeta.id_field, then this will be the values of that field in the
    results set.  Otherwise it's the ids in the results set.
    willkg committed Oct 26, 2011
  3. Change __len__ to not create a SearchResults

    __len__ and count() now return the length of the matches list from
    Sphinx.  Previously this would map Sphinx matches to actual db objects
    and return the length of that.  However, that means you're doing a big
    db hit every time you do a len() call on an S.
    We think this change, while making __len__ and count() less accurate,
    doesn't make a big difference since the DB can change after you call
    __len__/count() anyhow.
    willkg committed Oct 26, 2011
  4. Minor tweak to excerpt

    * Since we only excerpt a single result, it's easier to unwrap it from
      the list it gets returned in.
    * Additionally, go through and .decode('utf-8') all the texts in the
      excerpt--this is a hack for Kitsune.  If anyone else ever uses this,
      we'll have to fix it differently.
    * Added a test for excerpt which doesn't do much since it's got a mock
    willkg committed Oct 26, 2011
Commits on Oct 19, 2011
  1. Fix query differences

    * search.clients ignores Sphinx errors, but oedipus didn't.  This
      changes oedipus to log the error, but return [].
    * _sanitize_query wasn't sanitizing /.  This changes oedipus to
      sanitize / as \/.
    * Adds tests for the fixes.
    willkg committed Oct 19, 2011
Commits on Oct 18, 2011
  1. Fix excerpt problems

    * it's BuildExcerpts and not BuildExcerpt.
    * BuildExcerpts expects a list (specifically a list--not a tuple) as the
      first argument.
    willkg committed Oct 18, 2011
Commits on Oct 14, 2011
Commits on Oct 13, 2011
  1. Fix comment.

    willkg committed Oct 13, 2011
Commits on Oct 11, 2011
  1. Let people defer the determination of host and port till query time i…

    …f they wish.
    This allows for load balancing, testing, and such even if you're instantiating S objects at import time and leaving them around for later.
    committed Oct 11, 2011
  2. Smash all filter values down to ints *before* they hit sphinxapi.

    This lets us pass things like `filter(some_bool=False)` without having to define an explicit mapping for it.
    Renamed `_apply_filter_mappings()` because it does more now.
    committed Oct 11, 2011
Commits on Oct 10, 2011
  1. 20. Adds group_by

    Fixes #20.
    willkg committed Oct 6, 2011
Commits on Oct 6, 2011
  1. Pin versions in requirements.txt. at least people can get the darn thing working, even if a maintainer is lousy about backward compatibility promises.
    committed Oct 6, 2011
Commits on Oct 5, 2011
  1. Cosmetic tweaks to README

    * fixes line length
    * adds some additional vertical spaces between sections
    * fixes indentation of fixed-formatting blocks
    willkg committed Oct 5, 2011