Skip to content

Commit

Permalink
Generate en docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Milvus-doc-bot authored and Milvus-doc-bot committed Jan 6, 2025
1 parent 3b6ab41 commit 36c65b0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 19 deletions.
51 changes: 41 additions & 10 deletions localization/v2.5.x/site/en/menuStructure/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -701,22 +701,59 @@
"order": 5,
"children": []
},
{
"label": "Filtering",
"id": "filtering",
"order": 6,
"children": [
{
"label": "Filtering Explained",
"id": "boolean.md",
"order": 0,
"children": []
},
{
"label": "Basic Operators",
"id": "basic-operators.md",
"order": 1,
"children": []
},
{
"label": "Filtering Templating",
"id": "filtering-templating.md",
"order": 2,
"children": []
},
{
"label": "JSON Operators",
"id": "json-operators.md",
"order": 3,
"children": []
},
{
"label": "Array Operators",
"id": "array-operators.md",
"order": 4,
"children": []
}
]
},
{
"label": "Full Text Search",
"id": "full-text-search.md",
"order": 6,
"order": 7,
"children": []
},
{
"label": "Text Match",
"id": "keyword-match.md",
"order": 7,
"order": 8,
"children": []
},
{
"label": "Search Iterators",
"id": "with-iterators.md",
"order": 8,
"order": 9,
"children": []
},
{
Expand All @@ -725,16 +762,10 @@
"order": 9,
"children": []
},
{
"label": "Metadata Filtering",
"id": "boolean.md",
"order": 14,
"children": []
},
{
"label": "Reranking",
"id": "reranking.md",
"order": 15,
"order": 10,
"children": []
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ title: Filtering Explained
<ul>
<li><p><strong>Comparison Operators</strong>: <code translate="no">==</code>, <code translate="no">!=</code>, <code translate="no">&gt;</code>, <code translate="no">&lt;</code>, <code translate="no">&gt;=</code>, and <code translate="no">&lt;=</code> allow filtering based on numeric, text, or date fields.​</p></li>
<li><p><strong>Range Filters</strong>: <code translate="no">IN</code> and <code translate="no">LIKE</code> help match specific value ranges or sets.​</p></li>
<li><p><strong>Arithmetic Operators</strong>: <code translate="no">+</code>, <code translate="no">-</code>, <code translate="no">*</code>, <code translate="no">/</code>, <code translate="no">%</code>, and <code translate="no">**</code> are used for calculations involving numeric fields.​</p></li>
<li><p><strong>Arithmetic Operators</strong>: <code translate="no">+</code>, <code translate="no">-</code>, <code translate="no">*</code>, <code translate="no">/</code>, <code translate="no">%</code>, and `` are used for calculations involving numeric fields.​</p></li>
<li><p><strong>Logical Operators</strong>: <code translate="no">AND</code>, <code translate="no">OR</code>, and <code translate="no">NOT</code> or '&amp;&amp;’, '||’, '~’, ‘!’ combine multiple conditions into complex expressions.​</p></li>
</ul>
<h3 id="Example-Filtering-by-Color​" class="common-anchor-header">Example: Filtering by Color​</h3><p>To find entities with primary colors (red, green, or blue) in a scalar field <code translate="no">color</code>, use the following filter expression:​</p>
Expand Down Expand Up @@ -103,41 +103,41 @@ filter_params = {<span class="hljs-string">&quot;age&quot;</span>: <span class="
</svg>
</button></h2><p>Milvus provides advanced filtering operators for specific data types, such as JSON, ARRAY, and VARCHAR fields.​</p>
<h3 id="JSON-field-specific-operators​" class="common-anchor-header">JSON field-specific operators​</h3><p>Milvus offers advanced operators for querying JSON fields, enabling precise filtering within complex JSON structures:​</p>
<p><code translate="no">**JSON_CONTAINS(identifier, jsonExpr)**</code>: Checks if a JSON expression exists in the field.​</p>
<p><code translate="no">JSON_CONTAINS(identifier, jsonExpr)</code>: Checks if a JSON expression exists in the field.​</p>
<pre><code translate="no" class="language-python"># JSON data: {<span class="hljs-string">&quot;tags&quot;</span>: [<span class="hljs-string">&quot;electronics&quot;</span>, <span class="hljs-string">&quot;sale&quot;</span>, <span class="hljs-string">&quot;new&quot;</span>]}​
filter=<span class="hljs-string">&#x27;json_contains(tags, &quot;sale&quot;)&#x27;</span>​

<button class="copy-code-btn"></button></code></pre>
<p><code translate="no">**JSON_CONTAINS_ALL(identifier, jsonExpr)**</code>: Ensures all elements of the JSON expression are present.​</p>
<p><code translate="no">JSON_CONTAINS_ALL(identifier, jsonExpr)</code>: Ensures all elements of the JSON expression are present.​</p>
<pre><code translate="no" class="language-python"># JSON data: {<span class="hljs-string">&quot;tags&quot;</span>: [<span class="hljs-string">&quot;electronics&quot;</span>, <span class="hljs-string">&quot;sale&quot;</span>, <span class="hljs-string">&quot;new&quot;</span>, <span class="hljs-string">&quot;discount&quot;</span>]}​
filter=<span class="hljs-string">&#x27;json_contains_all(tags, [&quot;electronics&quot;, &quot;sale&quot;, &quot;new&quot;])&#x27;</span>​

<button class="copy-code-btn"></button></code></pre>
<p><code translate="no">**JSON_CONTAINS_ANY(identifier, jsonExpr)**</code>: Filters for entities where at least one element exists in the JSON expression.​</p>
<p><code translate="no">JSON_CONTAINS_ANY(identifier, jsonExpr)</code>: Filters for entities where at least one element exists in the JSON expression.​</p>
<pre><code translate="no" class="language-python"># JSON data: {<span class="hljs-string">&quot;tags&quot;</span>: [<span class="hljs-string">&quot;electronics&quot;</span>, <span class="hljs-string">&quot;sale&quot;</span>, <span class="hljs-string">&quot;new&quot;</span>]}​
filter=<span class="hljs-string">&#x27;json_contains_any(tags, [&quot;electronics&quot;, &quot;new&quot;, &quot;clearance&quot;])&#x27;</span>​

<button class="copy-code-btn"></button></code></pre>
<p>For more details on JSON operators, refer to <a href="/docs/json-operators.md">​JSON Operators</a>.​</p>
<h3 id="ARRAY-field-specific-operators​" class="common-anchor-header">ARRAY field-specific operators​</h3><p>Milvus provides advanced filtering operators for array fields, such as <code translate="no">ARRAY_CONTAINS</code>, <code translate="no">ARRAY_CONTAINS_ALL</code>, <code translate="no">ARRAY_CONTAINS_ANY</code>, and <code translate="no">ARRAY_LENGTH</code>, which allow fine-grained control over array data:​</p>
<p><code translate="no">**ARRAY_CONTAINS**</code>: Filters entities containing a specific element.​</p>
<p><code translate="no">ARRAY_CONTAINS</code>: Filters entities containing a specific element.​</p>
<pre><code translate="no" class="language-python"><span class="hljs-built_in">filter</span>=<span class="hljs-string">&quot;ARRAY_CONTAINS(history_temperatures, 23)&quot;</span>​

<button class="copy-code-btn"></button></code></pre>
<p><code translate="no">**ARRAY_CONTAINS_ALL**</code>: Filters entities where all elements in a list are present.​</p>
<p><code translate="no">ARRAY_CONTAINS_ALL</code>: Filters entities where all elements in a list are present.​</p>
<pre><code translate="no" class="language-python"><span class="hljs-built_in">filter</span>=<span class="hljs-string">&quot;ARRAY_CONTAINS_ALL(history_temperatures, [23, 24])&quot;</span>​

<button class="copy-code-btn"></button></code></pre>
<p><code translate="no">**ARRAY_CONTAINS_ANY**</code>: Filters entities containing any element from the list.​</p>
<p><code translate="no">ARRAY_CONTAINS_ANY</code>: Filters entities containing any element from the list.​</p>
<pre><code translate="no" class="language-python"><span class="hljs-built_in">filter</span>=<span class="hljs-string">&quot;ARRAY_CONTAINS_ANY(history_temperatures, [23, 24])&quot;</span>​

<button class="copy-code-btn"></button></code></pre>
<p><code translate="no">**ARRAY_LENGTH**</code>: Filters based on the length of the array.​</p>
<p><code translate="no">ARRAY_LENGTH</code>: Filters based on the length of the array.​</p>
<pre><code translate="no" class="language-python"><span class="hljs-built_in">filter</span>=<span class="hljs-string">&quot;ARRAY_LENGTH(history_temperatures) &lt; 10&quot;</span>​

<button class="copy-code-btn"></button></code></pre>
<p>For more details on array operators, see <a href="/docs/array-operators.md">​ARRAY Operators</a>.​</p>
<h3 id="VARCHAR-field-specific-operators​" class="common-anchor-header">VARCHAR field-specific operators​</h3><p>The <code translate="no">**Text_Match**</code> operator allows precise document retrieval based on specific query terms. It is particularly useful for filtered searches that combine scalar filters with vector similarity searches. Unlike semantic searches, Text Match focuses on exact term occurrences.​</p>
<h3 id="VARCHAR-field-specific-operators​" class="common-anchor-header">VARCHAR field-specific operators​</h3><p>The <code translate="no">Text_Match</code> operator allows precise document retrieval based on specific query terms. It is particularly useful for filtered searches that combine scalar filters with vector similarity searches. Unlike semantic searches, Text Match focuses on exact term occurrences.​</p>
<p>Milvus uses Tantivy to support inverted indexing and term-based text search. The process involves:​</p>
<ol>
<li><p><strong>Analyzer</strong>: Tokenizes and processes input text.​</p></li>
Expand Down

0 comments on commit 36c65b0

Please sign in to comment.