You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* To index **attachments' details**, call `AttachmentsFor()` within the index definition.
27
30
28
-
The `AttachmentsFor` method returns information about each attachment that extends
29
-
a specified document, including their names, sizes, and content type.
31
+
*`AttachmentsFor()` provides access to the **name**, **size**, **hash**, and **content-type** of each attachment a document has.
32
+
These details can then be used when defining the index-fields.
33
+
Once the index is deployed, you can query the index to find Employee documents based on these attachment properties.
34
+
35
+
* To index **attachments' content**, see the examples [below](../../document-extensions/attachments/indexing#index-details-&-content---by-attachment-name).
where search(AttachmentContent, "Colorado Dallas")
101
+
{CODE-TAB-BLOCK/}
80
102
{CODE-TABS/}
81
103
82
-
#### Indexes with `LoadAttachments()`
104
+
{PANEL/}
105
+
106
+
{PANEL: Index details & content - all attachments}
107
+
108
+
**The index**:
109
+
110
+
* Use `LoadAttachments()` to be able to index the **details & content** of ALL attachments.
111
+
112
+
* Note how the index example below is employing the [Fanout index](../../indexes/indexing-nested-data#fanout-index---multiple-index-entries-per-document) pattern.
where search(AttachmentContent, "Colorado Dallas") or AttachmentSize > 20000
130
+
{CODE-TAB-BLOCK/}
95
131
{CODE-TABS/}
96
132
97
133
{PANEL/}
@@ -101,17 +137,50 @@ public string GetContentAsString(); // Default: UTF-8
101
137
* Access to the indexed attachment content opens the door to many different applications,
102
138
including many that can be integrated directly into RavenDB.
103
139
104
-
*In this [blog post](https://ayende.com/blog/192001-B/using-machine-learning-with-ravendb),
105
-
Oren Eini demonstrates how image recognition can be applied to indexed attachments using the [additional sources](../../indexes/extending-indexes) feature.
Copy file name to clipboardExpand all lines: Documentation/5.4/Raven.Documentation.Pages/document-extensions/attachments/indexing.js.markdown
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,12 +30,13 @@
30
30
31
31
---
32
32
33
-
* To index attachments' details, call `attachmentsFor()` within the index definition.
33
+
* To index **attachments' details**, call `attachmentsFor()` within the index definition.
34
34
35
35
*`attachmentsFor()` provides access to the **name**, **size**, **hash**, and **content-type** of each attachment a document has.
36
36
These details can then be used when defining the index-fields.
37
+
Once the index is deployed, you can query the index to find Employee documents based on these attachment properties.
37
38
38
-
* To index attachments' content, see the examples below.
39
+
* To index **attachments' content**, see the examples [below](../../document-extensions/attachments/indexing#index-details-&-content---by-attachment-name).
0 commit comments