Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Sep 21, 2012
  1. @willkg
Commits on Sep 20, 2012
  1. @willkg

    Fix es_required_or_50x decorator

    willkg authored
    This tweaks the es_required_or_50x decorator to handle other ElasticSearch
    errors and also improves the documentation. It also allows for template
    overrides and nixes the msg arguments--they seemed less flexible.
    Note: These decorators have no tests in the test suite, yet.
Commits on Sep 11, 2012
  1. @willkg
  2. @willkg
Commits on Sep 4, 2012
  1. @willkg

    Implement MappingType and rewrite everything around it

    willkg authored
    tl;dr: This is a big rewrite with huge API-breaking changes.
    This replaces the old model-type system with the new MappingType
    system. This adds a degree of separation between models (traditionally
    stored in a db) and documents (stored in ElasticSearch).
    Untyped S works just like in v0.4 with the exception that if you
    don't specify values_dict or values_list, you now get back a list
    of DefaultMappingType which are slightly more useful than dicts.
    You can now create an S typed by a MappingType which makes it easier
    to specify the index and doctype, but also allows you to tie
    business logic to search results and also tie that back to db
    objects in a lazy-loading way. For example, say you had a description
    field and wanted to have a truncated version of it::
        class MyMappingType(MappingType):
            def description_truncated(self):
                return self.description[:100]
        res = list(S(MyMappingType).query(description__text='stormy night'))[0]
        print res.description_truncated()
    Also, inextricably linked with this commit is a minor rewrite of the
    test suite. They should run faster now, are better organized, and should
    be easier to write in the future. doesn't look like it
    was written by a shrewdness of apes any more.
    Also fixed a bug where `fields` was affected by ``values_list`` and
    ``values_dict`` calls---the two need to be separated.
  2. @willkg

    Tweak the search chapter title

    willkg authored
    Since it uses the ES Search API, it's better to call it "Searching
    with S" rather than "Querying with S".
  3. @willkg

    Re-add index to TOC.

    willkg authored
  4. @willkg

    Issue 54. Add docs for order-by

    willkg authored
    This also adds API documentation. It's not great because the docstrings
    need work, but it's better!
  5. @willkg

    Tweak MLT code; add docs

    willkg authored
    * tweaks the MLT class so that s isn't required anymore
    * adds an es argument
    * adds documentation
    * adds two more tests to make sure the s vs. index/doctype works
Commits on Aug 27, 2012
  1. @wraithan
  2. @willkg

    Overhaul Django SearchMixin and docs

    willkg authored
    * overhauls SearchMixin to be more useful and flexible but continue to
      have useful defaults
    * this overhauls a lot of the documentation for the contrib.django stuff
      and makes more of it correct
Commits on Aug 24, 2012
  1. @willkg
Commits on Aug 17, 2012
  1. @willkg

    Issue 51. Implement .demote()

    willkg authored
    This implements boosting query support, though it does it by dealing
    with the positive and negative queries as two separate things.
Commits on Aug 2, 2012
  1. @willkg

    Add release process

    willkg authored
    Mostly I'm adding this so I don't have to go figure it out again. Way
    easier to just document it and then it's documented for future
Commits on Jul 31, 2012
  1. @willkg

    Prepare for 0.4 release

    willkg authored
Commits on Jul 28, 2012
  1. @willkg

    Issue 27, 50. Add query_string and text_phrase.

    willkg authored
    * add support for query_string and text_phrase
    * adds documentation for both
    * adds handling for 'term' action
    * nixes documentation for startswith which is deprecated for prefix
      (though both work for now)
    * adds documentation for queries vs. filters
    * adds tests for the different query types
Commits on Jul 26, 2012
  1. @willkg

    Add ngrep to debugging chapter

    willkg authored
    It's super handy when writing sample programs that fiddle with things.
  2. @willkg

    Add sample program for facets

    willkg authored
Commits on Jul 25, 2012
  1. @willkg

    Fix docs on facet_counts

    willkg authored
Commits on Jul 21, 2012
  1. @willkg

    Issue 42. Implement highlight

    willkg authored
    This is a first pass at implementing highlight and it implements
    all the bits I need for SUMO.
    However, there's a lot of other stuff you can do with highlight
    and the docs I wrote don't really cover everything like why
    pre/post_tags need to be lists, fragment lengths, .. So there's
    more to do, but that can be done under the auspices of a different
Commits on Jul 19, 2012
  1. @willkg

    Issue 28. Implement query-time field boosts

    willkg authored
    This adds support for query-time field boosts. The docs cover how they
    work and get used.
    I also cleaned up _process_queries a little to make it less redundant
    and I fixed the which was using a typed S and shouldn't
    have been.
Commits on Jul 5, 2012
  1. @willkg

    Issue 38. Explain support

    willkg authored
    This adds support for 'explain' flag in searches, documentation, tests,
    and a function that formats the resulting explanation output so it's
    The latter is kind of a nice-to-have, so I stuck it in It's
    not documented, yet, because I figure it could use some work.
Commits on Jul 3, 2012
  1. @willkg

    Fix section on count/len in docs

    willkg authored
    q.count() != len(q)
    Suggesting those are the same is wrogn!
  2. @willkg

    Add seealso sections to docs

    willkg authored
    Adds links to the ES docs in relevant portions of the documentation.
  3. @willkg

    Issue 43. Reimplement facets

    willkg authored
    This reworks facets so that the API is cleaner and easier to use. It
    now has a .facet() which acts as a shorthand but doesn't do things
    you might not expect and it has a .facet_raw() which yields unto
    you the full expressive power of the ES facet.
    This adds some more tests and documentation and updates the CHANGELOG,
Commits on Jul 2, 2012
  1. @willkg

    Fix list results

    willkg authored
    If there was only one item in self.fields, then you'd end up with
    a flat list of things instead of a list of tuples. We want that
    to be consistent, though, so if we know we're in that situation, we
    fix it accordingly.
    This is a little awkward if you really want a flat list. Maybe we
    should make that easier in the future.
  2. @willkg

    Update docs

    willkg authored
    * updates and clarifies a bunch of bits in the documentation.
    * updates the documentation in respects to typed S and untyped S
      and search results and all that.
    * went through and tested the facet code. This updates the facet
    * PEP-257 fixes
Commits on Jun 28, 2012
  1. @willkg

    Issue 41. Move django bits to contrib

    willkg authored
    This reworks the codebase so that it doesn't require Django. There
    are some API breaking things here, but hopefully the changes required
    for users will be minimal.
Commits on Jun 26, 2012
  1. @willkg
  2. @willkg

    Issue 39. Clean up test code

    willkg authored
    * move the test code under elasticutils/
    * split up tests into a couple of files
    * create an ElasticTestCsae that skips tests if ElasticSearch isn't
    * changes the existing elasticutils/ to
      is the start of the Django shim
    * update documentation
    The result of all this is that now you can run tests by:
        DJANGO_SETTINGS_MODULE=es_settings nosetests
Commits on Jun 16, 2012
  1. @willkg

    Tweak F so that it allows for F()

    willkg authored
    This is something I implemented in the sumo branch to allow for an empty
    F. It makes it a lot easier to start with an F and add filters depending
    on what the user requested and also handle the case where there are
    no filters.
        f = F()
        f = f | F(tag='awesome')
    Prior to this change, that would result in:
        {"or_": [{}, {"tag": "awesome"}]}
    which makes ES grumpy and for good reason.
Commits on Jun 15, 2012
  1. @willkg
Commits on Jun 11, 2012
  1. @willkg

    Nix About ElasticUtils header

    willkg authored
    It's redundant and takes up a bunch of vertical space which means the
    text is further down the page than it should be.
Commits on Jun 9, 2012
  1. @willkg

    More query doc work

    willkg authored
    Ricky asked what the elasticsearch JSON looks like if you have filters
    and queries in it. I thought about that and decided to add more to the
    overview section so that there's a big example coupled with what it
    equates to in curl and then the rest of the document talks about
    individual pieces.
    I also added a separate section about S.
Commits on Jun 8, 2012
  1. @willkg

    Overhaul docs

    willkg authored
    This adds contributor docs and cleans up some of the elasticutils
    usage docs, too. It adds a lot of examples and expands on the existing
    This also adds a requirements-dev.txt which makes it a little easier
    to install for hacking.
    Still a lot of docs-work to do, but I think this is a nice first pass.
Something went wrong with that request. Please try again.