Skip to content

Commit 7903d37

Browse files
committed
build_index small improvements
1 parent 065ef02 commit 7903d37

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ python -m indexing.build_index --index-name <desired_index_name>
137137

138138
Add the argument `--path-to-data` if you want to use different data than what is provided in the data directory of this sample.
139139

140+
You can view and use the index you just created on the **Indexes** page of your Azure AI Studio project.
141+
140142
### Step 4b: Set the index reference
141143

142144
**Once you have the index you want to use, add the below entry to your .env file.** Note that the copilot code relies on this environment variable.

src/indexing/build_index.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,11 @@ def build_aisearch_index(index_name, path_to_data):
4343
tokens_per_chunk = 800, # Optional field - Maximum number of tokens per chunk
4444
token_overlap_across_chunks = 0, # Optional field - Number of tokens to overlap between chunks
4545
)
46+
print(f"Local Path: {index_path}")
4647

4748
# register the index so that it shows up in the cloud project
4849
client.indexes.create_or_update(Index(name=index_name, path=index_path))
4950

50-
print(f"Local Path: {index_path}")
51-
52-
ml_index=client.indexes.get(name=index_name, label="latest")
53-
54-
print(f"Cloud Path: {ml_index.path}")
55-
5651
if __name__ == "__main__":
5752
import argparse
5853
parser = argparse.ArgumentParser()
@@ -65,6 +60,6 @@ def build_aisearch_index(index_name, path_to_data):
6560
if not index_name:
6661
index_name = "product-info-index"
6762
if not path_to_data:
68-
path_to_data = "./indexing/data/product-info"
63+
path_to_data = "./indexing/data/product-info/"
6964

7065
build_aisearch_index(index_name, path_to_data)

0 commit comments

Comments
 (0)