source context
C0d7fcd0 3c06 4b61 Ac7b C280e04ab080
ctx:claims/beam/c0d7fcd0-3c06-4b61-ac7b-c280e04ab080Source document
full textbeam-chunk
text/plain1 KB
doc:beam/c0d7fcd0-3c06-4b61-ac7b-c280e04ab080credential = AzureKeyCredential(admin_key) client = SearchClient(endpoint=f"https://{service_name}.search.windows.net", index_name=index_name, credential=credential) # Define the index schema index_schema = { "name": index_name, "fields": [ {"name": "id", "type": "Edm.String", "key": True, "searchable": False}, {"name": "title", "type": "Edm.String", "searchable": True, "filterable": True, "sortable": True, "facetable": True}, {"name": "content", "type": "Edm.String", "searchable": True, "filterable": False, "sortable": False, "facetable": False} ] } # Create the index client.create_index(index_schema) # Add documents to the index documents = [ {"id": "1", "title": "Document One", "content": "This is the content of document one."}, {"id": "2", "title": "Document Two", "content": "This is the content of document two."} ] client.upload_documents(documents) ``` ### Setting Up AWS OpenSearch First, you need to create an OpenSearch domain and then set up an index. #### Prerequisites - AWS Account - AWS SDK for Python (`boto3`) Install the AWS SDK for Python: ```bash pip install boto3 ``` #### Create an Index in AWS OpenSearch
Facts in this context
Grouped by subject. Each subject links to its full article.
Source Document15 factsex:source_document
| comparisonTopic | Search Service Setup |
| containsCodeBlock | Bash Code Block |
| containsCodeBlock | Python Code Block |
| describes | Azure Search Setup |
| describes | Aws Opensearch Setup |
| hasMarkdownHeader | Header Level 4 |
| hasMarkdownHeader | Header Level 3 |
| hasProgrammingLanguage | Python |
| hasSection | Aws Opensearch Setup |
| hasShellLanguage | Bash |
| rdfs:label | Search Service Setup Guide |
| rdf:type | Technical Document |
| structureType | Technical Guide |
| targetAudience | Developers |
| totalCodeBlocks | 2 |
Aws Opensearch Setup13 factsex:aws_opensearch_setup
| cloudProvider | Amazon Aws |
| comparedWith | Azure Search Setup |
| competesWith | Azure Search Setup |
| hasPrerequisite | Aws Account |
| hasPrerequisite | Aws Sdk Python |
| hasStep | Setup Index Step |
| hasStep | Create Domain Step |
| hasSubSection | Create Index in Opensearch |
| rdfs:label | Setting Up AWS OpenSearch |
| rdf:type | Section |
| requires | Aws Account |
| siblingOf | Azure Search Setup |
| usesService | Aws Opensearch Service |
Azure Search Setup13 factsex:azure_search_setup
| cloudProvider | Microsoft Azure |
| comparedWith | Aws Opensearch Setup |
| competesWith | Aws Opensearch Setup |
| hasStep | Create Index Step |
| hasStep | Add Documents Step |
| hasVariable | Service Name |
| hasVariable | Admin Key |
| hasVariable | Index Name |
| rdfs:label | Azure Search Setup |
| rdf:type | Procedure |
| siblingOf | Aws Opensearch Setup |
| usesCredential | Credential |
| usesService | Azure Search Service |
Client9 factsex:client
| belongsToListing | Azure Search Client |
| calls | Create Index Method |
| calls | Upload Documents Method |
| hasParameter | Credential |
| hasParameter | Index Name |
| hasParameter | Endpoint |
| instantiates | Search Client |
| isAssigned | Search Client |
| targets | Index Name |
Title Field8 factsex:title_field
| hasName | title |
| hasProperty | Searchable Property |
| hasType | Edm.String |
| isFacetable | true |
| isFilterable | true |
| isSearchable | true |
| isSortable | true |
| similarTo | Content Field |
Document One6 factsex:document_one
| hasContent | This is the content of document one. |
| hasId | 1 |
| hasPart | Document One Content |
| isPartOf | Documents |
| rdfs:label | Document One |
| rdf:type | Document |
Documents6 factsex:documents
| hasMember | Document One |
| hasMember | Document Two |
| instantiates | List |
| isArray | true |
| isAssigned | List |
| usedBy | Upload Documents Method |
Document Two6 factsex:document_two
| hasContent | This is the content of document two. |
| hasId | 2 |
| hasPart | Document Two Content |
| isPartOf | Documents |
| rdfs:label | Document Two |
| rdf:type | Document |
Id Field6 factsex:id_field
| hasName | id |
| hasProperty | Key Property |
| hasType | Edm.String |
| isKey | true |
| isSearchable | false |
| oppositeOf | Content Field |
Index Schema6 factsex:index_schema
| hasFieldValue | Index Name |
| hasKey | fields |
| hasKey | name |
| instantiates | Dict |
| isAssigned | Dict |
| usedBy | Create Index Method |
Aws Sdk Python5 factsex:aws_sdk_python
| alias | boto3 |
| installationCommand | pip install boto3 |
| rdfs:label | AWS SDK for Python |
| rdf:type | Software Sdk |
| requiresInstallation | Install Command |
Create Index Method5 factsex:create_index_method
| hasParameter | Index Schema |
| precedes | Upload Documents Method |
| rdfs:label | create_index |
| rdf:type | Method |
| uses | Index Schema |
Upload Documents Method5 factsex:upload_documents_method
| follows | Create Index Method |
| hasParameter | Documents |
| rdfs:label | upload_documents |
| rdf:type | Method |
| uses | Documents |
Content Field4 factsex:content_field
| hasName | content |
| hasProperty | Non Searchable Property |
| hasType | Edm.String |
| isSearchable | true |
Credential4 factsex:credential
| hasArgument | Admin Key |
| instantiates | Azure Key Credential |
| isAssigned | Azure Key Credential |
| usedBy | Client |
Fields4 factsex:fields
| hasMember | Id Field |
| hasMember | Title Field |
| hasMember | Content Field |
| isArray | true |
Bash Code Block3 factsex:bash_code_block
| lineCount | 1 |
| rdfs:label | Bash Code Block |
| rdf:type | Code Block |
Code Block3 factsex:code_block
| contains | Azure Search Setup |
| rdfs:label | Python Code Example |
| rdf:type | Python Code |
Document One Content3 factsex:document_one_content
| hasText | This is the content of document one. |
| rdfs:label | Document One Content |
| rdf:type | Content |
Document Two Content3 factsex:document_two_content
| hasText | This is the content of document two. |
| rdfs:label | Document Two Content |
| rdf:type | Content |
Install Command3 factsex:install_command
| rdfs:label | pip install boto3 |
| rdf:type | Shell Command |
| usedFor | Aws Sdk Python |
Python Code Block3 factsex:python_code_block
| lineCount | 21 |
| rdfs:label | Python Code Block |
| rdf:type | Code Block |
Add Documents Step2 factsex:add_documents_step
| rdfs:label | Add Documents Step |
| rdf:type | Step |
Amazon Aws2 factsex:amazon_aws
| rdfs:label | Amazon AWS |
| rdf:type | Cloud Provider |
Aws Account2 factsex:aws_account
| rdfs:label | AWS Account |
| rdf:type | Prerequisite |
Aws Opensearch Service2 factsex:aws_opensearch_service
| rdfs:label | AWS OpenSearch |
| rdf:type | Cloud Service |
Azure Key Credential2 factsex:AzureKeyCredential
| rdfs:label | AzureKeyCredential |
| rdf:type | Class |
Azure Search Client2 factsex:azure_search_client
| rdfs:label | Azure Search Client |
| rdf:type | Search Client |
Azure Search Service2 factsex:azure_search_service
| rdfs:label | Azure Search Service |
| rdf:type | Cloud Service |
Bash2 factsex:bash
| rdfs:label | Bash |
| rdf:type | Shell Language |
Create Domain Step2 factsex:create_domain_step
| rdfs:label | Create Domain Step |
| rdf:type | Step |
Create Index in Opensearch2 factsex:create_index_in_opensearch
| rdfs:label | Create an Index in AWS OpenSearch |
| rdf:type | Sub Section |
Create Index Step2 factsex:create_index_step
| rdfs:label | Create Index Step |
| rdf:type | Step |
Developers2 factsex:developers
| rdfs:label | Software Developers |
| rdf:type | Role |
Dict2 factsex:dict
| rdfs:label | Dictionary |
| rdf:type | Python Type |
Endpoint2 factsex:endpoint
| hasValue | {service Name}.search.windows.net |
| isPartOf | Azure |
Header Level 32 factsex:header_level_3
| rdfs:label | Level 3 Header |
| rdf:type | Markdown Header |
Header Level 42 factsex:header_level_4
| rdfs:label | Level 4 Header |
| rdf:type | Markdown Header |
Index Name2 factsex:index_name
| rdfs:label | Index Name Variable |
| rdf:type | Variable |
Key Property2 factsex:key_property
| rdfs:label | Key Property |
| rdf:type | Field Property |
List2 factsex:list
| rdfs:label | List |
| rdf:type | Python Type |
Microsoft Azure2 factsex:microsoft_azure
| rdfs:label | Microsoft Azure |
| rdf:type | Cloud Provider |
Python2 factsex:python
| rdfs:label | Python |
| rdf:type | Programming Language |
Searchable Property2 factsex:searchable_property
| rdfs:label | Searchable Property |
| rdf:type | Field Property |
Search Client2 factsex:SearchClient
| rdfs:label | SearchClient |
| rdf:type | Class |
Search Service Setup2 factsex:search_service_setup
| rdfs:label | Search Service Setup |
| rdf:type | Topic |
Service Name2 factsex:service_name
| rdfs:label | Service Name Variable |
| rdf:type | Variable |
Setup Index Step2 factsex:setup_index_step
| rdfs:label | Setup Index Step |
| rdf:type | Step |
Technical Guide2 factsex:technical_guide
| rdfs:label | Technical Guide |
| rdf:type | Document Type |