Граф коммитов

166 Коммитов

Автор SHA1 Сообщение Дата
Will Kahn-Greene e075dbe45c Add Mike to CONTRIBUTORS 2013-01-16 17:30:51 -05:00
Will Kahn-Greene d850af8b89 Implement prefix filter support 2013-01-16 17:30:26 -05:00
Will Kahn-Greene 4510d6af90 Fix test errors if django is not installed
If django is not installed, then we don't import get_es and then this
code fails. But we don't need the get_es method on QueryTest anyhow,
so this nixes it.
2013-01-16 17:30:26 -05:00
Will Kahn-Greene 197221b06a Merge pull request #91 from mythmon/run-tests-helper
Add run_tests.py to setup Django for testing.
2013-01-16 14:33:12 -08:00
Mike Cooper cddc7f6d02 Add run_tests.py to setup Django for testing.
This will set up the Django environment so the Django-specific tests can
run. If Django is not present, the setup will be skipped and the tests
will be run normally. The testsuite will skip any Django-specific tests
in this case. This simplifies running the full test suite.
2012-12-12 14:20:17 -08:00
Will Kahn-Greene 714a5c95ad Issue 90. Nix silly exception "handling"
The problem here is that it's logging as an error and then re-raising.
That's kind of irritating. It's better to just let it propagate back
to the application and let it do whatever it wants to do.

Amongst other things, this is less spammy with sentry.
2012-12-03 10:14:38 -05:00
Will Kahn-Greene ccff9b21fa Fix stupid mistakes
* I had a bad import, so the Django tests were getting skipped--fixed
  that.
* Fixing that unearthed failing tests--fixed those.
2012-10-17 11:14:00 -04:00
Will Kahn-Greene 1578b373d1 Issue 85. Fix IndexMissingException.
Alleviate problems from a bug in pyes 0.15.
2012-10-17 09:20:17 -04:00
Will Kahn-Greene 7dcc0344d2 Issue 84. Fix get_indexes/get_doctypes silliness
All the S.get_indexes() returned a list of indexes except the one
in Django contrib which could return a basestring or a list of
indexes.

Ditto for S.get_doctypes().

This fixes that, adds docs, and adds tests.
2012-10-17 09:19:48 -04:00
Will Kahn-Greene cd76217549 Fix v0.5/v0.6 issues in changelog 2012-10-16 15:47:25 -04:00
Will Kahn-Greene 675419fd8b Update hacking_howto about django reqs. 2012-09-21 19:10:35 -04:00
Will Kahn-Greene 374d224298 Fix boosted text_phrase queries
text_phrase queries are really just text queries, so they require the
same value_key name. This fixes that and also writes a test for boosts
that runs through ES so we can verify it doesn't kick up a
SeachPhaseWhateverThingy.
2012-09-21 18:54:27 -04:00
Will Kahn-Greene a478db3556 Update release date for 0.5; add TOC 2012-09-21 13:17:07 -04:00
Will Kahn-Greene 292e18dcdd Add Giorgos to CONTRIBUTORS list 2012-09-21 10:30:56 -04:00
Will Kahn-Greene afbd458f6f Update CHANGELOG 2012-09-20 16:57:33 -04:00
Will Kahn-Greene 456641049a Fix error from last commit
It's MaxRetryError--not MaxRetryException.
2012-09-20 15:03:45 -04:00
Will Kahn-Greene dc20e3de56 Fix es_required_or_50x decorator
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.
2012-09-20 12:01:02 -04:00
Will Kahn-Greene 6e033446a5 Add note about refreshing after indexing. 2012-09-19 18:40:46 -04:00
Will Kahn-Greene 23bd386863 Add note about id and .index() 2012-09-19 15:29:50 -04:00
Will Kahn-Greene cefa09d19c Issue 74. Fix F operand mutations
Operations on F shouldn't mutate the operands. This fixes the code
so it does a deepcopy of the filters before doing things with them.
2012-09-14 13:30:53 -04:00
Will Kahn-Greene c2c1481af7 Tweak the filter caching text further. 2012-09-11 14:59:03 -04:00
Will Kahn-Greene 6b74736183 Add note about caching/speed in filter vs. query 2012-09-11 14:56:39 -04:00
Will Kahn-Greene ae2402822c Issue 70. Fix date_histogram handling.
* add handling for date_histogram in facet_counts
* fix facet_counts to raise an exception rather than silently act
  dumb if it doesn't recognize the _type
2012-09-07 16:40:22 -04:00
Will Kahn-Greene 547b6e2a0a Implement MappingType and rewrite everything around it
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. test_django.py 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.
2012-09-04 14:13:47 -04:00
Will Kahn-Greene b3a302345f Change _decorate_with_metadata to be less private 2012-09-04 13:44:52 -04:00
Will Kahn-Greene 4333f0b439 Add James Socol to CONTRIBUTORS
Bah--he contributed ages ago and I missed adding him.
2012-09-04 13:41:30 -04:00
Will Kahn-Greene e5952f7308 Set version to 0.6.dev 2012-09-04 13:31:32 -04:00
Will Kahn-Greene cc3e17cd18 Update CHANGELOG; prepare for v0.5 release 2012-09-04 13:30:35 -04:00
Will Kahn-Greene c457402521 Tweak the search chapter title
Since it uses the ES Search API, it's better to call it "Searching
with S" rather than "Querying with S".
2012-09-04 12:31:21 -04:00
Will Kahn-Greene 64b02a4d5d Re-add index to TOC. 2012-09-04 12:06:10 -04:00
Will Kahn-Greene 0fb6c14482 Issue 54. Add docs for order-by
This also adds API documentation. It's not great because the docstrings
need work, but it's better!
2012-09-04 11:57:55 -04:00
Will Kahn-Greene 623133eff0 Tweak MLT code; add docs
* 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
  correctly
2012-09-04 11:22:58 -04:00
Will Kahn-Greene 4ecefc901b Add Ricky to list 2012-08-31 16:50:43 -04:00
Ricky Rosario 591bed3c3e Fix Issue #53 - Implement more like this.
Adds a MLT class for making _mlt API calls.
2012-08-31 16:09:01 -04:00
Will Kahn-Greene 3009e0824b DEFAULT_INDEXES and DEFAULT_DOCTYPES are plural
These two defaults were wrong--they're both plural and should be a list
of strings. Other values are wrong.

This fixes that and also fixes a bunch of tests that broke because of it.
2012-08-31 14:15:45 -04:00
Will Kahn-Greene d71c14fd36 Issue 66. Add test for __in filter field action 2012-08-30 12:16:15 -04:00
Will Kahn-Greene 7d532373c9 Issue 63. Fix bad field action silent errors
This fixes query processing so if you have an invalid field action, it
now raises an exception--just like filters.
2012-08-30 10:53:49 -04:00
Will Kahn-Greene 557104d2e9 Issue 60. Implement terms query. 2012-08-30 10:51:43 -04:00
Will Kahn-Greene 964d866a93 Add Chris to CONTRIBUTORS 2012-08-27 12:54:59 -04:00
Will Kahn-Greene 548db51ada Merge pull request #62 from wraithan/patch-1
Add in missing colon in debugging docs
2012-08-27 09:55:48 -07:00
Chris McDonald 9760bfc1d4 Add in missing colon in debugging docs 2012-08-27 09:46:47 -07:00
Will Kahn-Greene 357f3ff19a Overhaul Django SearchMixin and docs
* 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
2012-08-27 11:16:08 -04:00
Will Kahn-Greene 4b305a442b Fix django reqs file; add docs reqs file
This should fix autodoc stuff on ReadTheDocs.
2012-08-24 17:08:22 -04:00
Will Kahn-Greene 9b157db7e2 Only need one fake settings file 2012-08-24 15:49:58 -04:00
Will Kahn-Greene 92f35dc654 Expose version in elasticutils.__version__
This also renames elasticutils.VERSION to elasticutils.PYES_VERSION
to avoid convusion.
2012-08-24 14:24:32 -04:00
Will Kahn-Greene 51a2248047 Merge pull request #57 from jsocol/master
Fix two small issues
2012-08-21 11:36:48 -07:00
James Socol fdf09e8e0c Ignore pycs and install all requirements. 2012-08-21 14:28:39 -04:00
Will Kahn-Greene 9008257136 Issue 51. Implement .demote()
This implements boosting query support, though it does it by dealing
with the positive and negative queries as two separate things.
2012-08-17 18:01:24 -04:00
Will Kahn-Greene 98f210e2b3 Add python language version classifiers 2012-08-06 11:43:07 -04:00
Will Kahn-Greene 414e4388a6 Add release process
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
maintainers.
2012-08-02 08:51:31 -04:00