Coder Social home page Coder Social logo

azure-search-dotnet-samples's Introduction

C# samples for Azure AI Search fundamentals

This repository contains C# code samples used in Azure AI Search "Day One" quickstarts and tutorials. Unless noted otherwise, all samples run on the shared (free) pricing tier of an Azure AI Search service.

In this repository

Sample Description
quickstart-full-text Learn the fundamental tasks of working with a search index: create, load, and query for full text search scenarios. This quickstart is a console application. The index is modeled on a subset of the Hotels dataset, widely used in Azure AI Search samples, but reduced to just four hotels for readability and comprehension.
quickstart-semantic-search Adds semantic search to the previous quickstart.
tutorial-skills-enrichment This console app creates an AI enrichment pipeline consisting of an index, indexer, data source, and skillset. The skillset calls Azure AI Services image analysis and OCR, and natural language processing, extract information and structure from heterogeneous blob content, making it searchable in Azure AI Search.
tutorial-create-mvc-app This ASP.NET Core MVC sample demonstrates server-side search behaviors, such as filters and sorting.
tutorial-search-website-functions-v4 This sample builds a website to search through a catalog of books then deploys the website to an Azure Static Web App. The search experience includes a React app for the front-end. This app includes a search bar for free text queries, suggestions for type-ahead queries, and document lookup.

Previously in this repository

The following samples are relocated to new repositories that align content to specific categories.

Sample New location
check-storage-usage azure-search-dotnet-utilities/check-storage-usage
data-lake-gen2-acl-indexing azure-search-dotnet-utilities/data-lake-gen2-acl-indexing
export-data azure-search-dotnet-utilities/export-data
index-backup-restore azure-search-dotnet-utilities/index-backup-restore
search-aggregations azure-search-dotnet-utilities/search-aggregations
multiple-data-sources azure-search-dotnet-scale/multiple-data-sources
multiple-search-services azure-search-dotnet-scale/multiple-search-services
optimize-data-indexing azure-search-dotnet-scale/optimize-data-indexing

More resources

azure-search-dotnet-samples's People

Contributors

brjohnstmsft avatar dependabot[bot] avatar dereklegenzoff avatar diberry avatar farzad528 avatar heidisteen avatar justinpeck avatar lisaleib avatar mattgotteiner avatar microsoftopensource avatar msftgits avatar robdixon22 avatar xuguang-yao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-search-dotnet-samples's Issues

Bug in name of config parameters: SearchServiceUri

In file appsettings.json used name: SearchServiceName
https://github.com/Azure-Samples/azure-search-dotnet-samples/blob/master/create-first-app/v11/1-basic-search-page/FirstAzureSearchApp/appsettings.json

but in function InitSearch used name SearchServiceUri

Directions for ConfigurationSetup()

For https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/index-backup-restore

The tags for the configuration setup are not correct -- should be (from code):

        **SourceSearchClient** = new SearchServiceClient(SourceSearchServiceName, new SearchCredentials(SourceAdminKey));
        **SourceIndexClient** = SourceSearchClient.Indexes.GetClient(SourceIndexName);


        **TargetSearchClient** = new SearchServiceClient(TargetSearchServiceName, new SearchCredentials(TargetAdminKey));
        **TargetIndexClient** = TargetSearchClient.Indexes.GetClient(TargetIndexName);

Issue with routing when using the HTML.ActionLink to call the PageAsynch method using Core 3.1. Do you happen to know how to resolve? I can get it to work in Core 5.0, but not Core 3.

This is related to the NumberedPaging app. It is developed in Asp.Net core 2.1.

The routing is different in the more current .net core frameworks: Looks something like this - app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});

It creates the url for each page, but does not fire the event, so if you have gotten this to work, would you mind sharing. Thanks!

Not able to filter on address

none of the below filters are working

$filter=Address/City eq 'San Antonio'

$filter=Address/StreetAddress eq '677 5th Ave'

Azure search index : Distict query requires a matching order by in order to return a continuation token

We are trying to create the index from cosmosDb.

Our collection data format -

[
	{
		"parent_name": "XYX-YXY",
		"parent_id": 123456,
		"childName": "abcd"
		"parent_image": "https://www.google.com/1.jpg",
		"_rid": "ZBQxAL3VfK5vDwAAAAAAAA==",
		"_ts": 1599155970
	},
	{
		"parent_name": "XYX-YXY",
		"parent_id": 123456,
		"childName": "abcd"
		"parent_image": "https://www.google.com/1.jpg",
		"_rid": "ZBQxAL3VfK5vDwAAAAAAAA==",
		"_ts": 1599155970
	},
	{
		"parent_name": "EDC-YXY",
		"parent_id": 123456,
		"childName": "abcde"
		"parent_image": "https://www.google.com/1.jpg",
		"_rid": "ZBQxAL3VfK5vDwAAAAAAAA==",
		"_ts": 1599155970
	},
	{
		"parent_name": "EDC-YXY",
		"parent_id": 123456,
		"childName": "abcd"
		"parent_image": "https://www.google.com/1.jpg",
		"_rid": "ZBQxAL3VfK5vDwAAAAAAAA==",
		"_ts": 1599155970
	}
]

Our goal to get the Distict records by parent_id

Our Query : SELECT DISTINCT (c.parent_id), c.parent_name FROM c WHERE c._ts > @highwatermark

While trying to create the data source getting below exception

{ "error": { "code": "", "message": "Error with data source: Query is invalid. Error: 'Distict query requires a matching order by in order to return a continuation token.\r\nIf you would like to serve this query through continuation tokens, then please rewrite the query in the form 'SELECT DISTINCT VALUE c.blah FROM c ORDER BY c.blah' and please make sure that there is a range index on 'c.blah'.' Please adjust your data source definition in order to proceed." } }

And then we tried adding the order by but still facing the issue

Query : SELECT DISTINCT (c.parent_id), c.parent_name FROM c WHERE c._ts > @highwatermark ORDER BY c.parent_id

Need suggestions to create the azure search index in these situations.

Thanks,
Sreekanth - Ecolab

instantiating SemanticSettings is causing a build error

The following line of code is causing a build error:

SemanticSettings semanticSettings = new SemanticSettings();

This came from Quickstart: semantic ranking - Azure AI Search | Microsoft Learn

I was able to follow the tutorial but when I copied the code into my web app it would not compile. Any idea why? I’ve attached the file I’m editing as well as the build log file. Thanks in advance for your help.

Kenneth
0_Build and Deploy Job.txt
Search.cs.txt

Issue while deploying static web app

While deploying Static web app and function , it did not show me below prompt

Select the location of your Azure Function code

Hence it did not deploy Azure Function

Missing property fieldMappings in constructor SearchIndexer

In the project multiple-data-sources/v11 fields are mapped on line 145

List<FieldMapping> map = new List<FieldMapping> {

but variable map is not used,
I think there should be some code like this (line 155)

 SearchIndexer blobIndexer = new SearchIndexer(
	name: "hotel-rooms-blob-indexer",
	dataSourceName: blobDataSource.Name,
	targetIndexName: indexName)
{
	Parameters = parameters,
	FieldMappings = map,
	Schedule = new IndexingSchedule(TimeSpan.FromDays(1))
};

Updating existing documents.

How about an example of updating an existing document? The behaviour for this seems to have changed quite a bit from 10 to 11.

How to Iterate through an Azure Index with more than 100,000 docs

The MS documentation says :
If your index has more than 100,000 documents, this sample, as written, will not work. This is because the REST API $skip feature, that is used for paging, has a 100K document limit. However, you can work around this limitation by adding code to iterate over, and filter on, a facet with less that 100K documents per facet value.

Can someone provide an example on how I would implement this loop to iterate through an index that has more than 100K docs?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.