Skip to content

Commit

Permalink
update index page
Browse files Browse the repository at this point in the history
Signed-off-by: ryjiang <[email protected]>
  • Loading branch information
shanghaikid committed Dec 19, 2023
1 parent 73d5808 commit dcfe14b
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 32 deletions.
7 changes: 5 additions & 2 deletions src/components/home/attu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ const Attu = props => {
onKeyDown={() => handleActiveClick(0)}
tabIndex={0}
>
{t('v3trans.home.attu.statistics')}
{t('v3trans.home.attu.operation')}
<span className="horizontal_shooting_star" />
</div>

<div
className={clsx('shooting-title', {
active: activeExample === 1,
Expand All @@ -79,6 +80,7 @@ const Attu = props => {
{t('v3trans.home.attu.manage')}
<span className="horizontal_shooting_star" />
</div>

<div
className={clsx('shooting-title', {
active: activeExample === 2,
Expand All @@ -88,9 +90,10 @@ const Attu = props => {
onKeyDown={() => handleActiveClick(2)}
tabIndex={0}
>
{t('v3trans.home.attu.operation')}
{t('v3trans.home.attu.statistics')}
<span className="horizontal_shooting_star" />
</div>

<div className="btn-groups">
<CustomIconLink
to="https://github.com/zilliztech/attu/releases"
Expand Down
73 changes: 50 additions & 23 deletions src/components/home/code-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ data = [
# Get an existing collection.
collection = Collection("book")
mr = collection.insert(data)
`,

upsert: `
import random
from pymilvus import Collection
# Parepare data
data = [
[i for i in range(2000)],
[i for i in range(10000, 12000)],
[[random.random() for _ in range(2)] for _ in range(2000)],
]
# Get an existing collection.
collection = Collection("book")
mr = collection.upsert(data)
`,
};

Expand Down Expand Up @@ -70,40 +85,52 @@ results = collection.search(
)
`,

timetravel: `
rangeSearch: `
from pymilvus import Collection
# Get an existing collection.
collection = Collection("book")
# Vector search with time travel
search_params = {"metric_type": "L2", "params": {"nprobe": 10}}
# Conduct a range search
search_params = {"metric_type": "L2", "params": {"nprobe": 10, "radius": 1, "range_filter": 0.1}}
results = collection.search(
data=[[0.1, 0.2]],
anns_field="book_intro",
param=search_params,
anns_field="book_intro",
param=search_params,
limit=10,
travel_timestamp: 428828271234252802, // Milvus hybrid timestamp
)
print(f"range search results: {results}")
`,
};

export const INSTALL_MILVUS = {
unbuntu: `
# Install via Launchpad PPA on Ubuntu
sudo apt install software-properties-common
sudo add-apt-repository ppa:milvusdb/milvus-standalone
sudo apt update
sudo apt install milvus
iterator: `
from pymilvus import Collection
# Get an existing collection.
collection = Collection("book")
search_params = {"metric_type": "L2", "params": {"nprobe": 10}}
# create a search iterator
search_iterator = collection.search_iterator(
data=[[0.1, 0.2]],
anns_field="book_intro",
param=search_params,
batch_size=500,
)
while True:
# turn to the next page
res = search_iterator.next()
if len(res) == 0:
print("search iteration finished, close")
# close the iterator
search_iterator.close()
break
for i in range(len(res)):
print(res[i])
`,
};

centos: `
# Install Milvus
sudo yum https://github.com/milvus-io/milvus/releases/download/v2.0.0-pre-ga/milvus-2.0.0-preGA.1.el7.x86_64.rpm
# Check Milvus status
sudo systemctl status milvus
sudo systemctl status milvus-etcd
sudo systemctl status milvus-minio
export const INSTALL_MILVUS = {
docker: `
# Download milvus-standalone-docker-compose.yml and save it as docker-compose.yml manually
wget https://github.com/milvus-io/milvus/releases/download/v2.3.3/milvus-standalone-docker-compose.yml -O docker-compose.yml
# In the same directory as the docker-compose.yml file, start up Milvus
sudo docker compose up -d
`,

kubernetes: `
Expand Down
7 changes: 4 additions & 3 deletions src/components/home/code.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,18 @@ const Code = props => {
switch (activeExample) {
case EXAMPLES.search:
return {
tabs: ['Vector search', 'Hybrid search', 'Time travel'],
tabs: ['Vector search', 'Hybrid search', 'Range Search', 'Iterator'],
learnMoreLink: `/docs/search.md`,
};
case EXAMPLES.manage:
return {
tabs: ['Create collection', 'Create index', 'Insert data'],
tabs: ['Create collection', 'Create index', 'Insert data', 'Upsert data'],
learnMoreLink: `/docs/create_collection.md`,
};
case EXAMPLES.install:
default:
return {
tabs: ['Ubuntu', 'CentOS', 'Kubernetes'],
tabs: ['Docker Compose', 'Kubernetes'],
learnMoreLink: `/docs/install_cluster-helm.md`,
};
}
Expand All @@ -143,6 +143,7 @@ const Code = props => {
<TabPanel value={value} index={0} codeExample={codeExample} />
<TabPanel value={value} index={1} codeExample={codeExample} />
<TabPanel value={value} index={2} codeExample={codeExample} />
<TabPanel value={value} index={3} codeExample={codeExample} />
</div>
<div className="milvus-feature">
<div
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/versions/master
Submodule master updated 860 files
4 changes: 2 additions & 2 deletions src/pages/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
min-height: 395px;
width: 100%;
height: auto;
background-image: url(../images/home/attu_1.jpeg);
background-image: url(../images/home/attu_3.jpg);
background-position: center;
background-repeat: no-repeat;
background-size: contain;
Expand All @@ -382,7 +382,7 @@
background-image: url(../images/home/attu_2.jpg);
}
&.attu-example-2 {
background-image: url(../images/home/attu_3.jpg);
background-image: url(../images/home/attu_1.jpeg);
}
}
}
Expand Down

0 comments on commit dcfe14b

Please sign in to comment.