Skip to content

feat: Cosmos DB NoSQL create-index samples and quickstart articles (Python, Go, .NET, Java, TypeScript)#92

Open
diberry wants to merge 6 commits into
Azure-Samples:mainfrom
diberry:feature/nosql-create-index-combined
Open

feat: Cosmos DB NoSQL create-index samples and quickstart articles (Python, Go, .NET, Java, TypeScript)#92
diberry wants to merge 6 commits into
Azure-Samples:mainfrom
diberry:feature/nosql-create-index-combined

Conversation

@diberry

@diberry diberry commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Combined PR: All 5 language implementations + quickstart articles

This PR combines PRs #88, #89, #90, #91 into a single deliverable.

What's included

Language Code Article
Python ✅ nosql-create-index-python/ ✅ quickstart-create-index-python.md
Go ✅ nosql-create-index-go/ ✅ quickstart-create-index-go.md
.NET ✅ nosql-create-index-dotnet/ ✅ quickstart-create-index-dotnet.md
Java ✅ nosql-create-index-java/ ✅ quickstart-create-index-java.md
TypeScript ✅ nosql-create-index-typescript/ ✅ quickstart-create-index-typescript.md

Shared infrastructure

  • \infra/cosmos-db/nosql/vector-containers.bicep\ — IaC for vector-enabled containers
  • \infra/database.bicep\ + \infra/main.bicep\ — updated deployment

Review status

PRs #88, #90, #91 achieved 8/8 unanimous approval via 8-agent specialist review (Variant B).

Supersedes: #88, #89, #90, #91

@diberry diberry force-pushed the feature/nosql-create-index-combined branch 10 times, most recently from bef5a66 to 7a5dd52 Compare June 9, 2026 22:55
…ython, Go, .NET, Java, TypeScript)

- Python: transactional batch inserts, azure-cosmos SDK, DefaultAzureCredential
- Go: concurrent goroutine inserts with semaphore, azcosmos SDK
- .NET: bulk executor pattern, Microsoft.Azure.Cosmos SDK
- Java: bulk operations, azure-cosmos SDK
- TypeScript: batch upsert, @azure/cosmos SDK
- Shared infra: vector-containers.bicep, updated database.bicep
- Quickstart articles for all 5 languages (8/8 agent approval)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the feature/nosql-create-index-combined branch from 7a5dd52 to 2cf3d52 Compare June 9, 2026 23:14
diberry and others added 5 commits June 10, 2026 15:00
- Document all 3 distance metrics (Cosine, Euclidean, DotProduct)
- Clarify that these are Cosmos DB NoSQL parameter names (not DocumentDB's)
- Add section on comparing all metrics with COMPARE_DISTANCE_METRICS=true
- Update expected output examples showing single metric and comparison modes
- Add RU cost tracking in comparison output
…ript, Java, .NET)

- Go: Added ValidDistanceFunctions, ExecuteMetricComparison, PrintMetricComparison
- TypeScript: Added VALID_DISTANCE_FUNCTIONS, runSingleMetricQuery, runMetricComparison
- Java: Added VALID_DISTANCE_FUNCTIONS, runSingleMetricQuery, runMetricComparison
- .NET: Added ValidDistanceFunctions, RunSingleMetricQuery, RunMetricComparison
- All languages now support VECTOR_DISTANCE_FUNCTION and COMPARE_DISTANCE_METRICS environment variables
- All samples now show RU costs per metric when in comparison mode

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…languages

- Python: Corrected 4-parameter VectorDistance query syntax with JSON options
- Go: Fixed distance function parameter handling and added metrics comparison
- TypeScript: Updated VectorDistance calls to use correct 4-parameter format with options object
- .NET: Fixed RequestCharge type issue and added command-line argument support for non-interactive execution
- Java: Fixed Maven Java 21 compatibility issue (now targets Java 17)

All samples now produce identical output with distance metrics (Cosine, Euclidean, DotProduct) correctly implemented. Verified consistency across all languages:
- Hotel rankings: Royal Cottage Resort, Country Comfort Inn, Nordick's Valley Motel, Economy Universe Motel, Roach Motel
- Metric scores identical within floating-point precision
- Request charges: ~8-9 RUs per metric across all implementations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Go, TypeScript, .NET, Java)

- Implement 2-algorithm × 3-metric comparison table output (DiskANN & QuantizedFlat with cosine, euclidean, dotproduct)
- Show Top 1 & Top 2 results with scores in unified ASCII table format
- Control comparison mode via COMPARE_DISTANCE_METRICS=true environment variable
- Python: Added metric comparison loop and table formatting
- Go: Port metric comparison from Python with case-insensitive handling
- TypeScript: Implement metrics table with proper result ordering
- .NET: Move COMPARE_DISTANCE_METRICS check early to bypass interactive menu
- Java: Fix field name validation by stripping quotes from .env values; configure maven-shade-plugin for runnable JAR with proper manifest

All 5 samples now produce comparable output when COMPARE_DISTANCE_METRICS=true is set.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ms × 3 distance functions)

- Python: Updated table to show COS, L2, IP metrics for both DiskANN and QuantizedFlat
- Go: Updated table to show COS, L2, IP metrics for both DiskANN and QuantizedFlat
- TypeScript: Created sample-output.txt with complete 6-row metrics table
- .NET: Updated table to show COS, L2, IP metrics for both DiskANN and QuantizedFlat
- Java: Updated table to show COS, L2, IP metrics for both DiskANN and QuantizedFlat

Each output now displays Top 1 & Top 2 results with scores for all metric combinations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant