Set default field options in index programmatically #15597
-
I want to index pdf-attachment for full text search. The index is added with In the Studio it is possible to add "default field options" to set the analyzer, I want to use "Full-Text Search: Yes" and "Indexing: Search". A statement like "Indexes.Add(x => x.Documents, FieldIndexing.Search);" will not compile because the field Documents is not part of the class Paper, it's only for the index. How can I add the default field options in code? That's the code:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
See in docs here how you can define the index structure: https://ravendb.net/docs/article-page/5.4/csharp/indexes/creating-and-deploying#example The index can have a completely different structure than the document you are indexing... (may index different documents) |
Beta Was this translation helpful? Give feedback.
-
You can add the following code to the index (after the map):
|
Beta Was this translation helpful? Give feedback.
You can add the following code to the index (after the map):