Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example to create an index #11751

Merged
merged 2 commits into from
May 3, 2020
Merged

Add example to create an index #11751

merged 2 commits into from
May 3, 2020

Conversation

heaths
Copy link
Member

@heaths heaths commented May 2, 2020

Fixes #9472

Also internalizes SearchFieldTemplate.Save which I forgot to do in an earlier PR.

Copy link
Member

@tg-msft tg-msft left a comment

Choose a reason for hiding this comment

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

Looks great

Comment on lines +199 to +200
//@@SearchIndex index = new SearchIndex("hotels")
/*@@*/ SearchIndex index = new SearchIndex(Recording.Random.GetName())
Copy link
Member

Choose a reason for hiding this comment

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

It would probably be safer to structure this as

SearchIndex index = new SearchIndex("hotels") /*@@*/;
/*@@*/ index = new SearchIndex(Recording.Random.GetName())

so we're still compiling the sample code and will refactor with tooling. We can do that in Preview 4 though.

Comment on lines +271 to +275
### Creating an index

You can use the `SearchServiceClient` to create a search index. Fields can be
defined using convenient `SimpleField`, `SearchableField`, or `ComplexField`
classes. Indexes can also define suggesters, lexical analyzers, and more.
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth linking to something like https://docs.microsoft.com/en-us/azure/search/search-what-is-an-index in here?

@heaths heaths merged commit 5454f64 into Azure:master May 3, 2020
@heaths heaths deleted the issue9472 branch June 28, 2022 17:46
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.

[Azure Cognitive Search] Need sample showing explicit Field construction
2 participants