Commit Graph

298 Commits

Author SHA1 Message Date
Kerollmops
314b89ca30
Fix insta snapshots 2022-10-27 11:35:20 +02:00
Loïc Lecrenier
9b43528bbb
Update test after fixing bug in index swap 2022-10-27 11:35:18 +02:00
Loïc Lecrenier
e641d08846
Cargo fmt 2022-10-27 11:35:18 +02:00
Kerollmops
2de8a0711a
Cargo insta test/review 2022-10-27 11:35:16 +02:00
Irevoire
033794d209
add tests for the task deletion and task cancelation 2022-10-27 11:35:16 +02:00
Irevoire
a85d5b4981
test the details of all tasks type 2022-10-27 11:35:16 +02:00
Kerollmops
4736e00253
Handle the CLI options related to snapshots 2022-10-27 11:35:15 +02:00
Irevoire
7e52f1effb
remove a lot of unecessary clone and ref 2022-10-27 11:35:11 +02:00
Loïc Lecrenier
2808be9d45
Fix the /swap-indexes route API
1. payload
2. error messages
3. auth errors
2022-10-27 11:35:10 +02:00
Irevoire
2c0fde4a1a
ignore the snapshot test 2022-10-27 11:35:08 +02:00
Irevoire
c8ee453b6c
fix the autobatched document deletion 2022-10-27 11:35:07 +02:00
Irevoire
99144b1419
fix most content file error 2022-10-27 11:35:06 +02:00
Irevoire
e107f1b282
fix the payload too large error 2022-10-27 11:35:06 +02:00
Irevoire
1bef5d119d
fix the api keys for the tasks route 2022-10-27 11:35:06 +02:00
Clément Renault
80b2e70ee7
Introduce a rustfmt file 2022-10-27 11:35:05 +02:00
Clément Renault
788262e588
Fix final compilation 2022-10-27 11:34:17 +02:00
Loïc Lecrenier
17cd2a4aa0
Implement POST /indexes-swap 2022-10-27 11:34:15 +02:00
Kerollmops
1ca9a67c49
Introduce the task cancelation task type 2022-10-27 11:34:11 +02:00
Tamo
f7e546eea3
make the tests compile again 2022-10-27 11:34:10 +02:00
Tamo
634eb52926
extract the create_app function for the tests 2022-10-27 11:34:09 +02:00
Loïc Lecrenier
8bb0fcd144
Finish first draft of the DELETE /tasks route 2022-10-27 11:34:04 +02:00
bors[bot]
ab1800551f
Merge #2922
2922: Add new error when using /keys without masterkey set r=ManyTheFish a=vishalsodani

# Pull Request

## Related issue
Fixes #2918 


Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?




Co-authored-by: vishalsodani <vishalsodani@rediffmail.com>
2022-10-27 09:13:11 +00:00
vishalsodani
03ba830ab2 uncomment tests 2022-10-27 12:59:28 +05:30
bors[bot]
25ec51e783
Merge #2601
2601: Ease search result pagination r=Kerollmops a=ManyTheFish

# Summary
This PR is a prototype enhancing search results pagination (#2577)

# Todo

- [x] Update the API to return the number of pages and allow users to directly choose a page instead of computing an offset
- [x] Change computation of `total_pages` in order to have an exact count
  - [x] compute query tree exhaustively
  - [x] compute distinct exhaustively

# Small Documentation

## Default search query

**request**:
```sh
curl \
  -X POST 'http://localhost:7700/indexes/movies/search' \
  -H 'Content-Type: application/json' \
  --data-binary '{ "q": "botman" }'
```

**result**:
```json
{
  "hits":[...],
  "query":"botman",
  "processingTimeMs":5,
  "hitsPerPage":20,
  "page":1,
  "totalPages":4,
  "totalHits":66
}
```

## Search query with offset parameter

**request**:
```sh
curl \
  -X POST 'http://localhost:7700/indexes/movies/search' \
  -H 'Content-Type: application/json' \
  --data-binary '{ "q": "botman", "offset": 0 }'
```

**result**:
```json
{
  "hits":[...],
  "query":"botman",
  "processingTimeMs":3,
  "limit":20,
  "offset":0,
  "estimatedTotalHits":66
}
```

## Search query selecting page with page parameter

**request**:
```sh
curl \
  -X POST 'http://localhost:7700/indexes/movies/search' \
  -H 'Content-Type: application/json' \
  --data-binary '{ "q": "botman", "page": 2 }'
```

**result**:
```json
{
  "hits":[...],
  "query":"botman",
  "processingTimeMs":5,
  "hitsPerPage":20,
  "page":2,
  "totalPages":4,
  "totalHits":66
}
```

# Related

fixes #2577

## In charge of the feature

Core: `@ManyTheFish` 
Docs: `@guimachiavelli` 
Integration: `@bidoubiwa` 


Co-authored-by: ManyTheFish <many@meilisearch.com>
2022-10-26 16:10:58 +00:00
vishalsodani
f0ecacb58d add implementation for no master key set and fix tests 2022-10-25 22:41:48 +05:30
ManyTheFish
1d217cef19 Add some tests 2022-10-20 17:03:07 +02:00
vishalsodani
1a61209596 fix wrong variant returned for invalid_api_key_indexes error 2022-10-18 19:41:06 +05:30
Andrey "MOU" Larionov
2dce44f4c1
Fix formatting and shaving lints 2022-10-13 15:49:23 +02:00
Andrey "MOU" Larionov
b69f8d67c3
Added test to verify response encoding
Alongside request encoding (compression) support, it is helpful to verify that the server respect `Accept-Encoding` headers and apply the corresponding compression to responses.
2022-10-13 00:56:57 +02:00
Andrey "MOU" Larionov
343a677566
Fix formatting and apply clippy suggestion 2022-10-10 11:04:46 +02:00
Andrey "MOU" Larionov
9dbc71cb6d
Added support for encoded payload
Actix provides different content encodings out of the box, but only if we use built-in content wrappers and containers. This patch wraps its own Payload implementation with an actix decoder, which enables request compression support.
2022-10-09 22:09:30 +02:00
Andrey "MOU" Larionov
11b986a81d
Added support for specifying compression in tests
Refactored tests code to allow to specify compression (content-encoding) algorithm.

Added tests to verify what actix actually handle different content encodings properly.
2022-10-09 22:09:29 +02:00
Andrey "MOU" Larionov
7607a62531
Split tests over two modules
Currently, `add_documents` contains some amount of `update` tests. This change should unify test structure with `index` module.
2022-10-09 22:03:22 +02:00
Clémentine Urquizar - curqui
a7d2c9572e
Merge branch 'main' into stable 2022-10-04 14:20:10 +02:00
bors[bot]
8ad5c3043c
Merge #2819
2819: Replace a meaningless serde message r=irevoire a=onyxcherry

# Pull Request

## What does this PR do?
Fixes #2680
<!-- Please link the issue you're trying to fix with this PR, if none then please create an issue first. -->

I've renamed the `serde_msg` variable to a `message` as _message_ does or does not include the serde error message --> is more generic.
## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: Tomasz Wiśniewski <tomasz@wisniewski.app>
2022-10-03 17:58:00 +00:00
Tomasz Wiśniewski
61a518a384 Fix #2680 - replace a meaningless serde message 2022-09-29 16:36:32 +02:00
Jakub Jirutka
05f93541d8 Skip dashboard test if mini-dashboard feature is disabled
Fixes the following error:

    cargo test --no-default-features
    ...
    error: couldn't read target/debug/build/meilisearch-http-ec029d8c902cf2cb/out/generated.rs: No such file or directory (os error 2)
     --> meilisearch-http/tests/dashboard/mod.rs:8:9
      |
    8 |         include!(concat!(env!("OUT_DIR"), "/generated.rs"));
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: could not compile `meilisearch-http` due to previous error
2022-09-29 01:42:52 +02:00
Many the fish
37dc6537c3
Fix api keys bugs (#2734)
* Add some tests

* Disallow index creation when API key doesn't havec explicitelly the right on the creating index

* Fix lazy index creation with `indexes.*` action
2022-09-06 15:13:09 +02:00
Tamo
6aa3ad6b6c
move prometheus behind a feature flag 2022-08-29 14:36:59 +02:00
Clément Renault
bebd76064a
Add test for the rights of /metrics route 2022-08-24 17:03:43 +02:00
ManyTheFish
e2af8dccb8 Fix filter tests 2022-08-23 16:39:39 +02:00
mohandasspat
a37c7ba1bb clippy & cargo fixed 2022-08-22 13:34:19 +05:30
mohandasspat
a05101af4d clippy & fmt fixed 2022-08-22 13:21:22 +05:30
Clément Renault
e32d5ef2b3
Fix the test with an uncomprehensible user error message 2022-08-18 14:37:44 +02:00
Clément Renault
5c543f9d94
Add a test for single document upload 2022-08-18 11:33:22 +02:00
ManyTheFish
b6e6a08f7d Fix CI test 2022-08-16 15:14:01 +02:00
ManyTheFish
ae174c2cca Fix task serialization 2022-08-11 13:35:35 +02:00
ManyTheFish
3a48de136e Add autobatching test 2022-08-10 17:02:29 +02:00
Kerollmops
e3426d5b7a Improve the tasks error reporting 2022-07-28 15:12:54 +02:00
Clémentine Urquizar - curqui
8e370ed9ab
Merge branch 'main' into stable 2022-07-11 14:41:15 +02:00