Skip to content

RDoc-4077 Corax: Document scoring of exists() and true - #2681

Open
Danielle9897 wants to merge 3 commits into
ravendb:mainfrom
Danielle9897:RDoc-4077-corax-scoring-of-exists-and-true
Open

Danielle9897 wants to merge 3 commits into
ravendb:mainfrom
Danielle9897:RDoc-4077-corax-scoring-of-exists-and-true

Conversation

@Danielle9897

@Danielle9897 Danielle9897 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Issue link

https://issues.ravendb.net/issue/RDoc-4077/Corax-Document-scoring-of-exists-and-true

Additional description

  • Documented the RavenDB 7.2.6 Corax scoring change:
    exists() contributes 1 × query boost once per matching document, while where true contributes no score.
  • Clarified the effects on scores, ordering, and performance across the related querying, boosting, and Corax articles.
  • Updated all client-language variants and added the missing Java and Python articles.

C#
@maciejaszyk pls review the *-csharp files

Node.js
@M4xymm pls review the *-nodejs.mdx files

Python & PHP
@poissoncorp pls review the *-python.mdx & *-php.mdx files

Java
@LielNagar pls review the *-java.mdx files


Type of change

  • Content - docs
  • Content - cloud
  • Content - Quill
  • Content - guides
  • Content - start pages/other
  • New docs feature (consider updating /templates or readme)
  • Bug fix
  • Optimization
  • Other

Changes in docs URLs

  • No changes in docs URLs
  • Articles are restructured, URLs will change, mapping is required (update /scripts/redirects.json file, set Documents Moved PR label)

Changes in UX/UI

  • No changes in UX/UI
  • Changes in UX/UI (include screenshots and description)

Comment on lines 29 to 31
# Only documents that contain field 'first_name' will be returned

results = list(session.advanced.document_query(object_type=Employee).where_exists("first_name"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Python queries use first_name / address.location.latitude, but the RQL tabs and the other Python examples in this PR use the stored names (FirstName, Fax, ...). On Northwind this one returns 0 results. Should be FirstName / Address.Location.Latitude?

Comment on lines 80 to 86
public function whereExists(?string $fieldName): DocumentQueryInterface;
```
<br/>

<TabItem value="whereexists_1" label="whereexists_1">
<CodeBlock language="php">
{`public function whereExists(?string $fieldName): DocumentQueryInterface;
`}
</CodeBlock>
</TabItem>

| Parameters | Type | Description |
| Parameter | Type | Description |
|----------------|-----------|----------------------------------------------------|
| **$fieldName** | `?string` | The name / path of the document field to filter by |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

whereExists() takes string, not ?string (DocumentQuery.php: whereExists(string $fieldName)).

Suggested change
public function whereExists(?string $fieldName): DocumentQueryInterface;
```
<br/>
<TabItem value="whereexists_1" label="whereexists_1">
<CodeBlock language="php">
{`public function whereExists(?string $fieldName): DocumentQueryInterface;
`}
</CodeBlock>
</TabItem>
| Parameters | Type | Description |
| Parameter | Type | Description |
|----------------|-----------|----------------------------------------------------|
| **$fieldName** | `?string` | The name / path of the document field to filter by |
public function whereExists(string $fieldName): DocumentQueryInterface;
```
<br/>
| Parameter | Type | Description |
|----------------|----------|----------------------------------------------------|
| **$fieldName** | `string` | The name / path of the document field to filter by |

</Admonition>
## Assign a boost factor to an index-field

<Panel heading="Assign a boost factor to an index-field">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

BTW This is Lucene only, Corax does not support indexing-time field boosting

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.

4 participants