Skip to content

Conversation

@GautierDele
Copy link
Member

@GautierDele GautierDele commented Aug 11, 2025

Summary by CodeRabbit

  • Documentation
    • Added a “Text search with trash” subsection, including JSON examples for trashed handling (trashed: "with" and trashed: "only") and how to set trashed behavior in requests.
    • Clarified that Laravel Scout Builder differs from Eloquent and that withTrashed is not applicable to text search.
    • Minor formatting update to the Impacts table (no semantic change).

@coderabbitai
Copy link

coderabbitai bot commented Aug 11, 2025

Warning

Rate limit exceeded

@GautierDele has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 21 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d4e4348 and 2f3423a.

📒 Files selected for processing (1)
  • content/2.endpoints/2.search.md (1 hunks)

Walkthrough

Documentation update to content/2.endpoints/2.search.md adding a “Text search with trash” subsection with JSON examples for trashed handling, clarifications about Laravel Scout Builder vs Eloquent, and a minor formatting change in the Impacts table. No code or API changes.

Changes

Cohort / File(s) Summary
Documentation: Search endpoint
content/2.endpoints/2.search.md
Added “Text search with trash” subsection; included JSON payload examples for trashed: "with"/"only"; clarified Scout Builder is not Eloquent and withTrashed isn’t a scope for text search; minor Impacts table formatting tweak (reintroduced sorts.field line).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A nibble of docs, a hop through the stash,
We query the burrow with “only” and “with” trash.
Scout isn’t Eloquent—so don’t be misled,
Ask via JSON, as the guide now has said.
Thump-thump! The search is clear—carrots ahead. 🥕🐇

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/text-search

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
content/2.endpoints/2.search.md (2)

576-577: Clarify wording and capitalization for sorts.field row

Tweak phrasing for correctness and consistency with “Scout”/“resource details” terminology.

-| `sorts.field`       | take scout fields instead of fields in resource detail |
+| `sorts.field`       | uses Scout fields instead of fields defined in resource details |

579-608: Tighten heading/grammar and explicitly document accepted values and default for text.trashed

  • Improve heading clarity and grammar.
  • Explicitly list allowed values for text.trashed and the default behavior.
  • Add a short note reminding that scopes (including withTrashed) are not supported with text search; use text.trashed instead.

Please confirm the default matches implementation (i.e., trashed records are excluded unless text.trashed is set).

-#### Text search with trash
-
-Because the Laravel Scout Builder is not built the same as the Eloquent one, `withTrashed` instruction is not a scope
-anymore and work differently:
+#### Text search with trashed models
+
+Because the Laravel Scout Builder differs from Eloquent, `withTrashed` is not a scope when performing text search.
+Instead, control trashed handling via the `text.trashed` option:
+
+- "with"  → include both non-trashed and trashed records
+- "only"  → include only trashed records
+- omitted → exclude trashed records (default)
+
+Note: When using text search, scopes are not supported (see Impacts above). Do not send `withTrashed` in `scopes`; use `text.trashed` instead.

 ```json
 // (POST) api/posts/search
 {
   "search": {
     "text": {
       "value": "my text search",
       "trashed": "with"
     }
   }
 }

-or for onlyTrashed:
+or for only trashed records:

// (POST) api/posts/search
{
  "search": {
    "text": {
      "value": "my text search",
      "trashed": "only"
    }
  }
}

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between b5e90977455468e5f4c8db9311516f677943c016 and d4e434869fde549e78e025106ebf9674e7e0a6c4.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `content/2.endpoints/2.search.md` (1 hunks)

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@GautierDele GautierDele merged commit c190b3f into main Aug 11, 2025
2 checks passed
@GautierDele GautierDele deleted the feature/text-search branch August 11, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants